logo

Viewing DataFrame Data

After loading data, you'll want to peek at it. Don't print the entire DataFrame - it could have millions of rows.

Use head() to see the first few rows:

df.head()      # First 5 rows
df.head(10)    # First 10 rows

Use tail() for the last rows - helpful for checking if your data loaded completely:

df.tail()

For a structural overview, info() shows column names, data types, and memory usage:

df.info()

And describe() gives statistical summaries of numeric columns:

df.describe()

These four methods are your first stop whenever you load new data. They reveal data types, missing values, and potential issues before you start analysis.

For systematic data exploration techniques, see The Ultimate Pandas Bootcamp.