Loading...

Plus+ Python

How to Transform Minute Data into Another Timeframe in Python

How to Transform Minute Data into Another Timeframe in Python
We often are asked how to transform minute OHLCV data into another time interval (ie. "Hi do you have 5min data for BTCUSDT?" or 15min etc?), and so we decided to write a premium article demonstrating how to do this in Python. Sometimes this technique is called "resampling" and may fit different end user cases. More specifically, it is a subtype of Resampling called "Downsampling", which decreases the frequency of samples (ie. 1min -> 15min) As always, every line of code is commented so that you know exactly what each line is supposed to do. We will use the Pandas library to accomplish this and write a new CSV file with our results. For the data set, we will use the one minute data available from FTX on this page and change the data into a 15minute interval.

Plus+ membership required

Create a Plus+ account to view the live codebase.

This article has a fully working, notebook-ready code block. Sign up for Plus+ to access it and the rest of the 20+ premium articles.

Subscribe to Plus+ Browse Plus+ articles