@@ -2281,23 +2281,23 @@ def _binop(self, other, func, level=None, fill_value=None):
2281
2281
2282
2282
def combine (self , other , func , fill_value = None ):
2283
2283
"""
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`.
2289
2285
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
+
2290
2291
Parameters
2291
2292
----------
2292
- other : Series or Scalar
2293
+ other : Series or scalar
2293
2294
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.
2301
2301
2302
2302
Returns
2303
2303
-------
@@ -2306,14 +2306,14 @@ def combine(self, other, func, fill_value=None):
2306
2306
Examples
2307
2307
--------
2308
2308
>>> 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])
2311
2311
>>> s1.combine(s2, lambda x1, x2: x1 if x1 < x2 else x2)
2312
2312
0 0
2313
2313
1 2
2314
2314
dtype: int64
2315
2315
2316
- >>> s2 = pd.Series([0,3, 4])
2316
+ >>> s2 = pd.Series([0, 3, 4])
2317
2317
>>> s1.combine(s2, lambda x1, x2: x1 if x1 > x2 else x2)
2318
2318
0 1
2319
2319
1 3
0 commit comments