pandas/head

View Top Rows

View the first few rows of a DataFrame

pandas
dataframe
view

Command

df.head

Explanation

df.head() is used to view the first n rows of a DataFrame. By default, it shows the first 5 rows.

Examples

View first 5 rows

df.head()

View first 10 rows

df.head(10)