pandas groupby one column code example
Example 1: dataframe, groupby, select one
df.sort_values('date').groupby(['id', 'period', 'type']).first()
Example 2: python groupby sum single columns
df.groupby(['A','C'], as_index=False)['B'].sum()
df.sort_values('date').groupby(['id', 'period', 'type']).first()
df.groupby(['A','C'], as_index=False)['B'].sum()