What does df.head() return in pandas?

Data Science with Python Easy

Data Science with Python — Easy

What does df.head() return in pandas?

Key points

  • df.head() returns the first few rows of the DataFrame
  • It is a quick way to preview the data
  • Default number of rows returned is 5
  • Useful for understanding the structure of the DataFrame

Ready to go further?

Related questions