Skip to content

Commit 795b5a1

Browse files
authored
Update series.py
1 parent d8c0633 commit 795b5a1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

pandas/core/series.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -2266,23 +2266,23 @@ def _binop(self, other, func, level=None, fill_value=None):
22662266

22672267
def combine(self, other, func, fill_value=None):
22682268
"""
2269-
Combine the Series with a Series or Scalar according to `func`.
2270-
2271-
Perform elementwise binary operation on two Series using given function
2272-
with optional `fill_value` when an index is missing from the Series or
2273-
the other value.
2269+
Combine the Series with a Series or scalar according to `func`.
22742270
2271+
Combine the Series and `other` using `func` to perform elementwise
2272+
selection for combined Series.
2273+
`fill_value` is assumed when value is missing from one
2274+
of the two objects being combined at some index.
2275+
22752276
Parameters
22762277
----------
2277-
other : Series or Scalar
2278+
other : Series or scalar
22782279
The value(s) to be combined with the `Series`.
2279-
func : Function
2280-
`function` that takes two Scalars as inputs and returns a `bool`.
2281-
fill_value : Scalar
2282-
The optional value to assume when an index
2283-
is missing from one Series or the other,
2284-
The default specifies to use the appropriate NaN value for
2285-
the underlying dtype of the Series.
2280+
func : function
2281+
Function that takes two scalars as inputs and returns a `bool`.
2282+
fill_value : scalar
2283+
The optional value to assume when an index is missing from
2284+
one Series or the other. The default specifies to use the
2285+
appropriate NaN value for the underlying dtype of the Series.
22862286
22872287
Returns
22882288
-------
@@ -2291,14 +2291,14 @@ def combine(self, other, func, fill_value=None):
22912291
Examples
22922292
--------
22932293
>>> import pandas as pd
2294-
>>> s1 = pd.Series([1,2])
2295-
>>> s2 = pd.Series([0,3])
2294+
>>> s1 = pd.Series([1, 2])
2295+
>>> s2 = pd.Series([0, 3])
22962296
>>> s1.combine(s2, lambda x1, x2: x1 if x1 < x2 else x2)
22972297
0 0
22982298
1 2
22992299
dtype: int64
23002300
2301-
>>> s2 = pd.Series([0,3,4])
2301+
>>> s2 = pd.Series([0, 3, 4])
23022302
>>> s1.combine(s2, lambda x1, x2: x1 if x1 > x2 else x2)
23032303
0 1
23042304
1 3

0 commit comments

Comments
 (0)