Category : date

I have a dictionary like this: > { "Country1": {"time": [1/22/20, 1/23/20…], "cases":[0,10,20,…]}, > "Country2": {"time": [1/22/20, 1/23/20…], "cases":[0,10,20,…]}, > …. } I want to drop the dates higher than a given date and their respective cases. I’ve tried with this, but it fails because of IndexError: list index out of range. How would yo ..

Read more

I would like to calculate the mean periode duration for the occurrence of different events. I got data where every event has an id and is tracked in a single line identified by its id. every time an event occurs the date of occurrence is saved. df_starting_point = pd.DataFrame( [{‘id’: 3, ‘0’: pd.to_datetime(‘2020-11-23T00:00:00.000000000’) , ‘1’: ..

Read more

for two separate dates I could use the solution in this link Count number of days between dates, ignoring weekends but what if I have columns of dates? how do I get the difference in that case? assuming these are the two columns. idx = pd.date_range(‘2020-01-01′,periods=26,freq=’D’) idx2 = pd.date_range(‘2020-02-01′,periods=26,freq=’D’) Source: Python..

Read more