Menu

Viewing the First Few Records

Viewing the First Few Records

Before performing any analysis, it is important to inspect the data.

Code

df.head()

Explanation

The head() function displays the first five rows of the dataset.

This helps us:

  • Verify that the dataset loaded correctly
  • Understand available columns
  • Identify the format of the data
  • Detect obvious data quality issues

This quick inspection is often the first step in exploratory data analysis.