5.3 Description
Using .describe()
on categorical data will produce similar output to a Series or
DataFrame of type string
.
In [1]: cat = pd.Categorical(["a", "c", "c", np.nan], categories=["b", "a", "c"])
In [2]: df = pd.DataFrame({"cat":cat, "s":["a", "c", "c", np.nan]})
In [3]: df.describe()
Out[3]:
cat s
count 3 3
unique 2 2
top c c
freq 2 2
In [4]: df["cat"].describe()
Out[4]:
count 3
unique 2
top c
freq 2
Name: cat, dtype: object