last day (101 days later) » 

12:14 PM
Hi, danish
 
 
2 hours later…
2:07 PM
Hi Shubham
 
hello
I have seen your question..
You are trying to subtract TimeDelta object from a numpy array, hence you are getting the error.
 
 
2 hours later…
4:12 PM
Let me know what you are trying to do when subtracting them
 
Ohh
Given the "tea" and "case" value in the dictionary I would like to update corresponding column.
Actually I have df with 5 columns.
User will pass the list of dictionary as shown below
The list will contain the information that which column has to be updated on which Time lines and how.
In case of end_date, start_date, and n_days
If user did not pass any then it will 0 as default
If all available consider end_date and start_date
If only two available calculate end_date and start_date
 
4:29 PM
Does your code logic is implemented correctly?
 
That also I am not sure
 
Because its really hard to debug the code...
 
Did u understand my code
 
Nope, Its way too long code, so without complete logic its very difficult to understand..;)
 
Let me explain the logic
U can easily implement that
 
4:30 PM
Just a small suggestion to you when writing such functions
Longer function tend to obscure the readibility of code. Do try to split the function as multiple sub-functions, so a golden thumb rule is that your function should not contain more than 20-25 lines of code max.
 
If "tea":
[
{
"type": "df",
"from": "2020-02-01T20:00:00.000Z",
"to": "2020-02-03T20:00:00.000Z",
"days":3,
"coef":[0.1,0.1,0.1,0.1,0.1,0.1],
"case":"bad"
}
Sure, noted
But I could not split that.
I want to change the column Tea_bad and replace df[' Tea_bad'], for that location
 
Danish, Can you give me a min?
I will came back shortly.
 
4:49 PM
Hello Danish
 
Hi Shubham
Take ur time Shubham
It is not urgent
Just for my learning
It is an interesting problem
For that location means for that time duration
Since "type": "df"
end_date = d["to]
start_date = d["from"]
If "tea":
[
{
"type": "linear",
"from": "2020-02-04T20:00:00.000Z",
"to": "2020-02-08T20:00:00.000Z",
"days":3,
"coef":[0.1,0.1,0.1,0.1,0.1,0.1],
"case":"good"
}
The list will contain the information that which column has to be updated on which Time lines and how.
1. Which column?
Ans - Tea_Good
2. which Time lines?
Ans - "from": "2020-02-04T20:00:00.000Z",
"to": "2020-02-08T20:00:00.000Z"
 
5:07 PM
@Danish Thanks..
 
3. How?
Ans - Polynomial
Do u remember? u have answered my question. how to implement linear, polynomial, quadratic, same way
 
@Danish yes i do. Just need to read all the conditions carefully ;)
 
Noted, Thanks.
I think for your caliber level, it is very easy. I was trying for this last one week.
 
Thanks Danish appreciate your comment, will look into it as soon as possible, and i will let you know with the outcome.
Can you wait until tomorrow if possible?
 
Sure
Take your time.
 
5:18 PM
Thanks :). Bye!
 
Bye
Thank you so much for your kindness.
I really appreciate that.
God bless u
 
No problem.
 

  last day (101 days later) »