How to find the start time and end time of an event in python?
问题 I have a data frame consists of column 1 i.e event and column 2 is Datetime: Sample data Event Time 0 2020-02-12 11:00:00 0 2020-02-12 11:30:00 2 2020-02-12 12:00:00 1 2020-02-12 12:30:00 0 2020-02-12 13:00:00 0 2020-02-12 13:30:00 0 2020-02-12 14:00:00 1 2020-02-12 14:30:00 0 2020-02-12 15:00:00 0 2020-02-12 15:30:00 And I want to find start time and end time of each event: Desired Data Event EventStartTime EventEndTime 0 2020-02-12 11:00:00 2020-02-12 12:00:00 2 2020-02-12 12:00:00 2020-02