Open
Description
Currently, there isn't a direct way to aggregate features by time intervals. For example, given this dataset of transactions, an expected output can be the total amount on each day.
ID Amount Time
0 1.5 2020-06-02 19:06:40.012210
1 5.0 2020-06-02 10:06:40.012241
2 2.3 2020-06-02 09:06:40.012252
3 6.0 2020-06-01 18:06:40.012261
4 9.0 2020-06-01 13:06:40.012271
5 3.0 2020-06-01 11:06:40.012280
grouper = pd.Grouper(key='Time', freq='1d')
df.groupby(grouper)['Amount'].sum()
Time
2020-06-01 18.0
2020-06-02 8.8
Freq: D, Name: Amount, dtype: float64