Categories
Python Answers

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

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *