Python: Get aggregate of minutes for each day
1 min read
I have a dataframe with hour and minute data for each day:
hour minute
00 00
00 01
00 02
00 03
00 04
00 05
...
00 59
01 00
01 01
...
How can I get the aggregate of the minutes column? i.e. the minute of the day rather than the hour. I want the minute column to be continuous t have the following:
hour minute
00 00
00 01
00 02
00 03
00 04
00 05
...
00 59
01 60
01 61
...
How can this be done? (note that my data is pd.datetime and I have already split it into df.dt.hour and df.dt.minute)
資料來源:Stackoverflow