groupby and sum in pandas code example

Example 1: pandas groupby sum

df.groupby(['Fruit','Name'])['Number'].sum()

Example 2: knowing the sum null values in a specific row in pandas dataframe

note:df is syour dataframe 

print(df['emp_title'].isnull().sum())

Example 3: how to add three conditions in np.where in pandas dataframe

import numpy as np
idx = np.where((df['Salary_in_1000']>=100) & (df['Age']< 60) & (df['FT_Team'].str.startswith('S')))

Example 4: pandas groupby sum

df.groupby(['att1', 'att2']).agg({'att1': "count", 'att3': "sum",'att4': 'mean'})

Example 5: python groupby sum single columns

df.groupby(['A','C'], as_index=False)['B'].sum()

Example 6: pandas sum group by

df.groupby(['Fiscal_Year','Billing_Group'])['CHARGE_AMT'].sum()