1CLASS FEATURE1 FEATURE2 FEATURE3
2 X A NaN NaN
3 X NaN A NaN
4 B A A A
5
6 df.drop('CLASS', 1).isna().groupby(df.CLASS, sort=False).sum().reset_index()
7
8 CLASS FEATURE1 FEATURE2 FEATURE3
90 X 1.0 1.0 2.0
101 B 0.0 0.0 0.0