My Dataframe is like below:
data = {
'Date': ['2020-01-01', '2020-01-01', '2020-01-01', '2020-01-14', '2020-01-14', '2020-02-14', '2020-02-14', '2020-12-25', '2020-12-25'],
'Concert': ['New Year Gala', 'MJ Concert', 'Robbinson Concert', 'Robbinson Concert', 'Dance Night', 'Valentine Dance', 'Love Dub Event', 'Christmas Party', 'Rocky Concert']
}
filtered_df = pd.DataFrame(data)
filtered_df.groupby('Date')['Concert'].apply(list)
Post above operation I am getting:
[New Year Gala, MJ Concert, Robbinson Concert], [Robbinson Concert, Dance Night], [Valentine Dance, Love Dub Event], [Christmas Party, Rocky Concert]
What I want to get:
I want to merge rows with even one overlap into one, for example: row 1 and row 2 have overlap, so, they should be merged. In above, given the groupby is over date this scenario is arising.
Expected output:
[New Year Gala, MJ Concert, Robbinson Concert, Dance Night], [Valentine Dance, Love Dub Event], [Christmas Party, Rocky Concert]