I have a created a dataframe consisting of two columns. I want to count the number of occurences over these two columns.
The dataframe looks like-
No Name
1 A
1 A
5 T
9 V
Nan M
5 T
1 A
And I want to use value_counts() to get a dataframe like this-
No Name Count
1 A 3
5 T 2
9 V 1
Nan M 1
I tried doing df[["No", "Name"]].value_counts() which counts everything except the nan row. Is there a way to use value_counts() to count Nan as well?