I want to count the number of occurrences over two columns of a DataFrame :
No Name
1 A
1 A
5 T
9 V
Nan M
5 T
1 A
I expected df[["No", "Name"]].value_counts()
to give
No Name Count
1 A 3
5 T 2
9 V 1
Nan M 1
But I am missing the row containing NaN.
Is there a way to include NaNs in value_counts()?