...

/

Add the Values of a Pandas Series

Add the Values of a Pandas Series

Let's learn how to add the values of two pandas series.

We'll cover the following...

Try it yourself

Try executing the code below to see the result.

Python 3.8
import pandas as pd
grades = pd.Series([61, 82, 57])
bonuses = pd.Series([10, 5, 10, 10])
out = grades + bonuses
print(out)

Explanation

The pandas.Series and numpy.ndarray are different from Python lists. The + operator included on Python lists does concatenation:

 ...