'Preserve Timestamp Column during Pandas Groupby
I have a sizeable pandas df that I would like to aggregate by a Timestamp. The timestamps are on a granular scale(one second). Post aggregation, I would like the df to retain the first instance of that timestamp, but aggragated the following data by one minute periods.
Original:
Timestamp Column
22-02-23 9:30:00 1
22-02-23 9:30:01 4
...
22-02-23 9:33:04 4
22-02-23 9:33:05 7
Grouped:
Timestamp Column
22-02-23 9:30:00 5
...
22-02-23 9:33:04 11
Is there a pandas function for this? Or does this aggregation need to be done manually?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
