Given previous datetime values in a Pandas DataFrame–either as an index or as values in a column–is there a way to “autofill” remaining time increments based on the previous fixed …

# Tag: time-series

## How to select top n columns from time series data instead of using nlargest in pandas?

I have weekly based trade export time-series data that I need to make a stacked bar plot for visualizing trade activity. To do so, I aggregated my data for sum-up of each columns for all rows, then …

## Python – How to clean time series data

I have a df which looks like this: df = pd.DataFrame({‘Date’:[‘2019-09-23′,’2019-09-24′,’2019-09-25′,’2019-09-26′,’2019-09-27′,’2019-09-28′,’2019-09-29’], ‘Sep’:[1,10,5,’NaN’,’NaN’,’…

## How to forecast out of sample with AutoRegression from statsmodel?

I have time-series sales data. First I group-by the sales by a year. Than I want to forecast the sales for the years 2021,2022 and 2023. I have data from the year 2000. My question is similar to this …

## How can you get rolling value count (frequency) with Pandas? (computationally efficient, no loops)

I have a list of values and I want to get their rolling frequency, so something like this: df = pd.DataFrame({ ‘val’: [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3] }) result = df.val.rolling(3)….

## 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 …

## Machine Learning Classifier use past predictions as features

I want to built a binary classifier machine learning model. I want to use the model’s previous predictions as features for the future predictions, to take into account that my training samples are not …

## 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 […]

## decompose() for time series: ValueError: You must specify a period or x must be a pandas object with a DatetimeIndex with a freq not set to None

I have some problems executing an additive model right. I have the following data frame: And when I run this code: I got that message: ValueError: You must specify a period or x must be a pandas object with a >DatetimeIndex with a freq not set to None What should I do in order to get that example: The screen

## Pandas: How to fill missing dates in a long dataframe with multiple non overlapping time series?

I have a long dataframe with multiple timeseries which are non overlapping. The df looks like this For the time series with id 1, the missing timestamps are 5,6 and 7 and the time series #2 misses timestamps 0 and 1. I would like to fill the missing dates for all the time series in the dataframe so all of