groupby and aggregate pandas code example
Example 1: two groupby pandas
In [8]: grouped = df.groupby('A')
In [9]: grouped = df.groupby(['A', 'B'])
Example 2: pandas sum group by
df.groupby(['Fiscal_Year','Billing_Group'])['CHARGE_AMT'].sum()
Example 3: how can i aggregate without group by in pandas
df.groupby(lambda _ : True).agg(new_col_name = ('col_name', 'agg_function'))