0PricingLogin
Data Science Academy · Lesson

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

  1. A Column With a Name and Index
  2. Label-Based vs Position-Based Access
  3. Series Math and Alignment
  4. Counting and Spotting Values
← Back to Data Science Academy