.describe(), .info(), and .shape
Table of Contents
Toggle
Once data is loaded, your first task is to understand its **size**, **type**, and **distribution**. Pandas gives us quick tools to do this: .info(), .describe(), and .shape. Let’s break them down with examples.
df.info()Shows column names, data types, non-null counts, and memory usage.
df.info()
Use it when: You want to check for missing values and datatype mismatches.
df.describe()Gives statistical summary of numeric columns — mean, std, min, max, etc.
df.describe()
Use it when: You need a bird’s eye view of data distributions.
df.shapeReturns the dimensions (rows, columns) of the DataFrame.
df.shape
Example: (891, 12) → 891 rows, 12 columns
Combine .info() and .describe() with visualizations to validate what your stats suggest!
df.describe() and interpret the mean vs median.df.info() to check for missing data.⏭️ Next up: Visualizing data with Matplotlib – Let’s plot!
