1A B C
20 foo one NaN
31 bar one bla2
42 foo two NaN
53 bar three bla3
64 foo two NaN
75 bar two NaN
86 foo one NaN
9
10df2 = df.C.isnull().groupby([df['A'],df['B']]).sum().astype(int).reset_index(name='count')
11print (df2)
12 A B count
130 bar one 0
141 bar three 0
152 bar two 1
163 foo one 2
174 foo three 1
185 foo two 2