length of dataframe python 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: length of pandas dataframe
df.shape[0]
# Returns the number of rows in this DataFrame
df.count()
# 2
df.shape[0]