Python and dataframe and datetime object -- 2
$30-250 USD
Paid on delivery
I want to create a new variable New_variable in the following dataset.
The rule for the New_variable is: if a consequential row started within 1 or less from any previous rows' Start or End variables' values, then it should have valued the same otherwise incrementally increases by 1.
Existing Data:
ID Start End New_variable
A 1 1 1
A 0.8 8 1
A 4 4 1
A 18 19 2
B 1 1 1
B 4 6 2
Next, when adding new observations, it also should have the same rule as above, but it should not change the previous New_variable-s values, but add consequentially even the Start value is smaller than the very first row of existing data's start value, see below the desired output.
New Data:
ID Start End
A -5 0
A 6 6
A 10 11
A 23 23
C 1 2
The desired output should be as below:
Existing and New Data:
ID Start End New_variable
A -5 0 3
A 1 1 1
A 0.8 8 1
A 4 4 1
A 6 6 1
A 10 11 4
A 18 19 2
A 23 23 5
B 1 1 1
B 4 6 2
C 1 2 1
Project ID: #27863026
About the project
8 freelancers are bidding on average $118 for this job
*** Python Dataframe Expert with Pandas *** I read your project description very carefully. I have a deep understanding and experience in the areas of python that you mentioned. I've previously worked on the similar More
I'm a Python expert with rich experience. I read the job details extremely carefully. I can develop a Python script to create a new variable New_variable in the given dataset. I'm ready to do it now. I will wait fo More
HI, I am experienced developer in the field of AI, ML, deep learning and Time series analysis (Algo Trading) and have been working as data scientist from last two years. I can handle task by using Python( Tensorflow, k More
Hi Dear, I read your description carefully. I understood what you require me to do and I am filled with confidence that I can complete your project wonderfully. I have experience over 5+ years with Python and etc. I en More