bigframes.pandas.Series.update#

Series.update(other: Series | Sequence | Mapping) None[source]#

Modify Series in place using values from passed Series.

Uses non-NA values from passed Series to make updates. Aligns on index.

Examples:

>>> s = bpd.Series([1, 2, 3])
>>> s.update(bpd.Series([4, 5, 6]))
>>> s
0    4
1    5
2    6
dtype: Int64
>>> s = bpd.Series(['a', 'b', 'c'])
>>> s.update(bpd.Series(['d', 'e'], index=[0, 2]))
>>> s
0    d
1    b
2    e
dtype: string
>>> s = bpd.Series([1, 2, 3])
>>> s.update(bpd.Series([4, 5, 6, 7, 8]))
>>> s
0    4
1    5
2    6
dtype: Int64

If other contains NA (NULL values) the corresponding values are not updated in the original Series.

>>> s = bpd.Series([1, 2, 3])
>>> s.update(bpd.Series([4, np.nan, 6], dtype=pd.Int64Dtype()))
>>> s
0    4
1    2
2    6
dtype: Int64

other can also be a non-Series object type that is coercible into a Series

>>> s = bpd.Series([1, 2, 3])
>>> s.update([4, np.nan, 6])
>>> s
0    4.0
1    2.0
2    6.0
dtype: Float64
>>> s = bpd.Series([1, 2, 3])
>>> s.update({1: 9})
>>> s
0    1
1    9
2    3
dtype: Int64
Parameters:

other (Series, or object coercible into Series)

Returns:

None