Add the Values of a Pandas Series
Let's learn how to add the values of two pandas series.
We'll cover the following...
We'll cover the following...
Try it yourself
Try executing the code below to see the result.
Press + to interact
Python 3.8
import pandas as pdgrades = pd.Series([61, 82, 57])bonuses = pd.Series([10, 5, 10, 10])out = grades + bonusesprint(out)
Explanation
The pandas.Series
and numpy.ndarray
are different from Python lists. The +
operator included on Python lists does concatenation: