heads in dataframe code example Example 1: head pandas python # Returns the first 5 rows df.head(n=5) Example 2: python - head df.head(10) df.tail(10)