Examples

In [31]:
import numpy as np
import pandas as pd
In [32]:
x = pd.Series([1, 1, 1, np.nan], index=['p', 'q', 'r', 's'])
x
Out[32]:
p    1.0
q    1.0
r    1.0
s    NaN
dtype: float64
In [33]:
y = pd.Series([1, np.nan, 1, np.nan], index=['p', 'q', 'r', 's'])
y
Out[33]:
p    1.0
q    NaN
r    1.0
s    NaN
dtype: float64
In [34]:
x.add(y, fill_value=0)
Out[34]:
p    2.0
q    1.0
r    2.0
s    NaN
dtype: float64