I have a DataFrame which has two columns with dates and string value as below:
date Name Cost
0 2010-09-15 ABC XYZ 100
1 2010-09-16 PQR RTS 30
2 2010-09-17 DEF GHI 20
3 2010-09-18 LKJ POD 80
4 2010-09-19 WER HDF 10
5 2010-09-20 WFG MNB 30
I want to merge rows with dates in period of 3 days as below:
date Name Cost
0 2010-09-15 ABC XYZ PQR RTS DEF GHI 50
1 2010-09-18 LKJ POD WER HDF WFG MNB 40
Cost column takes mean value and strings just add as strings. I tried making date ranges in different DataFrame and then merging with conditions but I am not getting desired values.