About this question
Easy · data_manipulation · Quant Researcher interview question · pandas, time-series, resampling, data-manipulation, python, average-trade-price
Grouping trades into fixed time intervals is a common preprocessing step in market-data analysis. Computing one average price per interval reduces high-frequency observations into a regular, chronological series for downstream analysis. Task Implement a function solution(trades, period) that groups executed trades into fixed time buckets and calculates the arithmetic mean of the observed trade prices in each non-empty bucket. Each trade observation has equal weight. This exercise does not calcu