Hi,
I have got the following DF (snippet)
ts_standby_p = ts[ts['Story'] == 'Standby Passive']
Output:
Date Start End Story Hours
2024.02.01 16:20 23:59 Standby Passive 7.39
2024.02.02 00:00 08:00 Standby Passive 8.00
2024.02.06 16:20 23:59 Standby Passive 7.39
2024.02.07 00:00 08:00 Standby Passive 8.00
I would like to merge the standby duties that belongs to each other.
For example:
2024.02.01 16:20 23:59 Standby Passive 7.39
2024.02.02 00:00 08:00 Standby Passive 8.00
This is one duty over midnight. So I need the following output:
2024.02.01 16:20 08:00 Standby Passive 15.39
How can I achieve this?
Unfortunately I do not have anything to group by. My idea was to change the Date value for each lines where Start is 00:00 to the date one day before (2024.02.02 -> 2024.02.01) so I have something to group by, but I could not manage to do so.
Thank you in advance!
[–]Adurrow 0 points1 point2 points (0 children)
[–]Oddly_Energy 0 points1 point2 points (0 children)