Command
df.headExplanation
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)df.headdf.head() is used to view the first n rows of a DataFrame. By default, it shows the first 5 rows.
View first 5 rows
df.head()View first 10 rows
df.head(10)