Series & DataFrames
The two core pandas structures, and what's actually inside a DataFrame.
A Series is a 1-D labeled array: think of it as a NumPy array with an index attached. A DataFrame is a 2-D table: a dict of Series that all share the same index, one per column.
| Method | Shows | Example |
|---|---|---|
| first / last n rows |
|
| (rows, columns) | a 3-row, 2-column DataFrame → |
| the dtype of every column |
|
| count/mean/std/min/quartiles/max for numeric columns | one row per stat, one column per numeric field |
| dtypes + non-null counts in one summary | prints column names, non-null counts, and dtypes |
💡 Tip: df['col'] returns a Series (1-D); df[['col']] with double brackets returns a one-column DataFrame (2-D). The bracket style changes the result type.
Now practice it
Exercises that use what this lesson just covered.