Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Need help in converting the 1 min time series data into 15 min data in the research environment. I want to calculate moving averages for the same data instead of the 1m data.

I tried using resampling. However, it's showing some error.

2 responses

The 'resample' method should be used like this. See the pandas docs https://pandas.pydata.org/pandas-docs/version/0.18/generated/pandas.DataFrame.resample.html

closes_15_min   =  pricing.resample("15T").last()  

The above takes the last value every 15 minutes. One can apply different resampling functions such as mean or median too.

Hello! I have been trying to resample data as there are multiple columns in my DataFrame I had to use something like this. Anyways the link definitely helped as a trigger. Thank you

prices = pricing.resample('3T').agg({'open_price': 'first',
'high': 'max',
'low': 'min',
'close_price': 'last',
'volume' : 'sum'}). head()