Pandas Series
The one-dimensional Pandas data structure — a labelled array for a single column
A Pandas Series is a one-dimensional labelled array. Think of it as a single column from a spreadsheet — it has values and an index (row labels). When you access one column from a DataFrame (df["Sales"]), you get a Series.
Understanding Series is important because most Pandas column operations work at the Series level — filtering, applying functions, computing statistics, handling nulls.
Example
Key Points
- ✓A Series has values and an index — index can be numbers or labels
- ✓df["column"] returns a Series; df[["col1","col2"]] returns a DataFrame
- ✓.iloc[n] accesses by position; .loc["label"] accesses by label
- ✓.describe() gives a full statistical summary in one call
- ✓.value_counts() shows frequency of each unique value — great for categorical columns
Practice Question
How do you access a single column "Sales" from a DataFrame df as a Series?