Skip to content

Tag: time-series

Python – How to clean time series data

I have a df which looks like this: I’m trying to create a new column called ‘First_Contract’: ‘First_Contract’ needs to take the third-last value of ‘Sep’ column, before ‘Sep’column reaches NaN. The subsequent values need to be filled with ‘Dec&#8217…

Equidistant timeseries filling the blanks

I have the following code that generates a timeseries with 1 min steps but would like to have the time gaps filled. i.e 13:58 is missing in between. Every ip should be represented in the gap with zero values. How can this be achieved? Answer First change unstack by first level for DatetimeIndex, and add DataF…