pandas dataframe top 5 code example Example 1: python - head df.head(10) df.tail(10) Example 2: pandas show top 10 rows df.head(10)