I have a Dataframe containg text and some value counts e.g.:
dates=['01-01-15','01-01-15','01-01-15','02-01-15','02-01-15','02-01-15','02-01-15']
df3 = pd.DataFrame({'Number':['001','001','001','002','002','002','002'],
'name':['peter','chris','meg','albert','cathrine','leo','leo'],
'dummy':[0,1,0,0,0,1,1],
'dates': dates})
df3.dates=pd.to_datetime(df3.dates)
Now i want to group it by the "Number" column and sum, so that the values will be summed and the text will become one list with all entries, and each group will have one date.
If i use df4=pd.DataFrame(df3.groupby('Number').sum())
it performs the necessary operations on the numeric data, but loses the text and date column.
So the output shold look like:
df4
Number name dummy dates
001 [peter,chris,meg] 1 01-01-15
002 [albert, cathrine, leo,leo] 2 02-01-15