Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
s = pd.Series([2, 3, 4])
s.update(pd.Series([5, 6, 7]))
s
Out[2]:
0    5
1    6
2    7
dtype: int64

In [3]:
s = pd.Series(['p', 'q', 'r'])
s.update(pd.Series(['s', 't'], index=[0, 2]))
s
Out[3]:
0    s
1    q
2    t
dtype: object
In [4]:
s = pd.Series([2, 3, 4])
s.update(pd.Series([5, 6, 7, 8, 9]))
s
Out[4]:
0    5
1    6
2    7
dtype: int64

If other contains NaNs the corresponding values are not updated in the original Series.

In [5]:
s = pd.Series([1, 2, 3])
s.update(pd.Series([6, np.nan, 8]))
s
Out[5]:
0    6
1    2
2    8
dtype: int64