I have a data set with actions that have a start and end time. I'd like to label each row part of day (morning, noon, evening, night). Since some actions might start at one part and end in the other, I'd like to consider where most of the time was spent.
Say that morning is 6am-11am and noon is 11am-2am and I have an action between 10:30am to 1pm it should be labeled as noon.
One approach I though was to create a column for each part of day and calculate the number of seconds spent in each part (per row) then use idxmax to find the part of day. But then how do I calculate the time overlap between (start, stop) to the part of day?