get the number of features in a dataframe code example
Example 1: Returns the number of rows in this DataFrame
# Returns the number of rows in this DataFrame
df.count()
# 2
Example 2: pandas count
>>> df.set_index(["Person", "Single"]).count(level="Person")
Age
Person
John 2
Lewis 1
Myla 1