I am using Pandas to structure and process Data. This is my DataFrame:
I grouped many datetimes by minute and I did an aggregation in order to have the sum of 'bitrate' scores by minute.
This was my code to have this Dataframe:
return (datetime.datetime.strptime(time, '%Y-%m-%d %H:%M:%S')).replace(second=0)
data['new_time'] = data['beginning_time'].apply(delete_seconds)
df = (data[['new_time', 'bitrate']].groupby(['new_time'])).aggregate(np.sum)
df.groupby([df.index.map(lambda t: t.5minute)]).aggregate(np.mean)
This assumes your index is properly set as a DateTimeIndex.
you can also use the TimeGrouper, as resampling is really just a groupby operation on time buckets.