Skip to content

Commit 63c6b4b

Browse files
committed
Update series.py
1 parent 6d1dae6 commit 63c6b4b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

pandas/core/series.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,23 +2281,23 @@ def _binop(self, other, func, level=None, fill_value=None):
22812281

22822282
def combine(self, other, func, fill_value=None):
22832283
"""
2284-
Combine the Series with a Series or Scalar according to `func`.
2285-
2286-
Perform elementwise binary operation on two Series using given function
2287-
with optional `fill_value` when an index is missing from the Series or
2288-
the other value.
2284+
Combine the Series with a Series or scalar according to `func`.
22892285
2286+
Combine the Series and `other` using `func` to perform elementwise
2287+
selection for combined Series.
2288+
`fill_value` is assumed when value is missing from one
2289+
of the two objects being combined at some index.
2290+
22902291
Parameters
22912292
----------
2292-
other : Series or Scalar
2293+
other : Series or scalar
22932294
The value(s) to be combined with the `Series`.
2294-
func : Function
2295-
`function` that takes two Scalars as inputs and returns a `bool`.
2296-
fill_value : Scalar
2297-
The optional value to assume when an index
2298-
is missing from one Series or the other,
2299-
The default specifies to use the appropriate NaN value for
2300-
the underlying dtype of the Series.
2295+
func : function
2296+
Function that takes two scalars as inputs and returns a `bool`.
2297+
fill_value : scalar
2298+
The optional value to assume when an index is missing from
2299+
one Series or the other. The default specifies to use the
2300+
appropriate NaN value for the underlying dtype of the Series.
23012301
23022302
Returns
23032303
-------
@@ -2306,14 +2306,14 @@ def combine(self, other, func, fill_value=None):
23062306
Examples
23072307
--------
23082308
>>> import pandas as pd
2309-
>>> s1 = pd.Series([1,2])
2310-
>>> s2 = pd.Series([0,3])
2309+
>>> s1 = pd.Series([1, 2])
2310+
>>> s2 = pd.Series([0, 3])
23112311
>>> s1.combine(s2, lambda x1, x2: x1 if x1 < x2 else x2)
23122312
0 0
23132313
1 2
23142314
dtype: int64
23152315
2316-
>>> s2 = pd.Series([0,3,4])
2316+
>>> s2 = pd.Series([0, 3, 4])
23172317
>>> s1.combine(s2, lambda x1, x2: x1 if x1 > x2 else x2)
23182318
0 1
23192319
1 3

0 commit comments

Comments
 (0)