Skip to content
Advertisement

Python: Date range into time series with corresponding values

My data set is much larger so I have simplified it.

I want to convert the dataframe into a time-series.

The bit I am stuck on:

I have overlapping date ranges, where I have a smaller date range inside a larger one, as shown by row 0 and row 1, where row 1 and row 2 are inside the date range of row 0.

JavaScript

How I want the output to look:

JavaScript

Advertisement

Answer

I think this does what you want…

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement