dataframe
id beg end
guest1 2021-10-21 17:00:00 2021-10-21 18:00:00
guest2 2021-10-21 10:00:00 2021-10-22 10:00:00
I want to test
if the client appears exactly one time and beg and end are not the same day then do like (guest1). col1 gets 2021-10-21 00:00:00 and col2 gets beg
if the client appears exactly one time and beg and end are the same day then do like (guest2).
id beg end col1 col2
guest1 2021-10-21 17:00:00 2021-10-21 18:00:00 2021-10-21 00:00:00 2021-10-21 17:00:00
guest1 2021-10-21 17:00:00 2021-10-21 18:00:00 2021-10-21 18:00:00 2021-10-21 23:59:59
guest2 2021-10-21 10:00:00 2021-10-22 11:00:00 2021-10-21 00:00:00 2021-10-21 10:00:00