I need to make groupby depending on a condition which includes two columns, so for example, I have the following dataframe:
item start_date end_date
A 10/03/2019 31/03/2019
B 10/03/2019 31/03/2019
A 31/03/2019 10/04/2019
B 31/03/2019 10/04/2019
and I need to groupbyon items if the end_date equals to the start_date and resulting row should have the start_date of the first row and the end_date of the second row
item start_date end_date
A 10/03/2019 10/04/2019
B 10/03/2019 10/04/2019
An easier example:
item start_date end_date
A a b
A b c
A d e
A e f
The wanted result:
item start_date end_date
A a c
A d f