Category Data Age Location
A 30 44 212 Street
A 20 54 212 Street
A 20 48 212 Street
A 10 49 209 Street
A 40 12 209 Street
A 30 21 209 Street
A 30 32 220 Street
A 35 24 220 Street
A 25 22 220 Street
this is part of my pandas df. I wish to group ober category and sum data and keep unique location in list
df.groupby(['Category']).agg({'Location': pd.Series.unique, 'Data': 'sum'})
This is throwing value error for Location.
ValueError: Function does not reduce
What am I doing wrong? I would like to put unique location in groupby column..