Before analysing anything, you look. These commands are the first things you run on every new DataFrame — they reveal the shape, the types, the missing values and the distribution of each column.
The first look
| Command | Tells you |
|---|---|
df.head() | First 5 rows (tail() for the last) |
df.shape | (rows, columns) |
df.info() | Columns, non-null counts, dtypes |
df.describe() | Summary stats for numeric columns |
df["col"].value_counts() | Frequency of each value |
df.head()df.info() # ← always run this firstdf.describe()df["programme"].value_counts()df.isna().sum() # missing values per column
Start with info()
Key takeaways
- 01head/shape/info/describe/value_counts are the standard first look at any DataFrame.
- 02df.info() reveals dtypes and non-null counts — run it first.
- 03df.describe() summarises numeric columns; value_counts() shows category frequencies.
- 04df.isna().sum() counts missing values per column.
