About this question

OHLC Resampling (Tick to Bar) with Polars

Medium · time_series · Quant Researcher interview question · polars, data-processing, market-microstructure

Converting high-frequency tick data into OHLCV (Open, High, Low, Close, Volume) bars is a critical preprocessing step for market microstructure analysis and strategy backtesting. Utilizing the Polars library allows for high-performance, memory-efficient resampling of large datasets through its dynamic grouping capabilities. Task Implement the function solution(df) that accepts a Polars DataFrame containing tick data and downsamples it into 1-minute OHLCV bars. The function must return a DataFra