Menu Close

How to get the row count of a Python Pandas DataFrame?

To get the row count of a Python Pandas DataFrame, we can use various properties.

We can write one of

  • len(df.index)
  • df.shape[0]
  • df[df.columns[0]].count()

to get the row count of a Pandas dataframe.

df is the dataframe.

Posted in Python, Python Answers