Examples
Constructing DataFrame from a dictionary:

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({"Person":
                   ["Jhonny", "Mira", "Tom", "Jhonny", "Mira"],
                   "Age": [26., np.nan, 24., 35, 36],
                   "Single": [False, True, True, True, False]})
df
Out[2]:
Person Age Single
0 Jhonny 26.0 False
1 Mira NaN True
2 Tom 24.0 True
3 Jhonny 35.0 True
4 Mira 36.0 False

Pandas: Dataframe - Constructing DataFrame from a dictionary.

Notice the uncounted NA values:

In [3]:
df.count()
Out[3]:
Person    5
Age       4
Single    5
dtype: int64

Pandas: Dataframe - Notice the uncounted NA values.

Counts for each row:

In [4]:
df.count(axis='columns')
Out[4]:
0    3
1    2
2    3
3    3
4    3
dtype: int64

Pandas: Dataframe - Counts for each row.

Counts for one level of a MultiIndex:

In [5]:
df.set_index(["Person", "Single"]).count(level="Person")
Out[5]:
Age
Person
Jhonny 2
Mira 1
Tom 1