Series Math and Alignment
How labels auto-align during operations.
Math on Whole Columns
You can do math on an entire Series at once. Operations apply to every value together, so there is no loop to write. ⚡
Add a Scalar
Adding a single number to a Series adds it to every value. This broadcast happens automatically across the whole column.
import pandas as pd
s = pd.Series([10, 20, 30])
print(s + 5)All lessons in this course
- A Column With a Name and Index
- Label-Based vs Position-Based Access
- Series Math and Alignment
- Counting and Spotting Values