@@ -2266,23 +2266,23 @@ def _binop(self, other, func, level=None, fill_value=None):
2266
2266
2267
2267
def combine (self , other , func , fill_value = None ):
2268
2268
"""
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`.
2274
2270
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
+
2275
2276
Parameters
2276
2277
----------
2277
- other : Series or Scalar
2278
+ other : Series or scalar
2278
2279
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.
2286
2286
2287
2287
Returns
2288
2288
-------
@@ -2291,14 +2291,14 @@ def combine(self, other, func, fill_value=None):
2291
2291
Examples
2292
2292
--------
2293
2293
>>> 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])
2296
2296
>>> s1.combine(s2, lambda x1, x2: x1 if x1 < x2 else x2)
2297
2297
0 0
2298
2298
1 2
2299
2299
dtype: int64
2300
2300
2301
- >>> s2 = pd.Series([0,3, 4])
2301
+ >>> s2 = pd.Series([0, 3, 4])
2302
2302
>>> s1.combine(s2, lambda x1, x2: x1 if x1 > x2 else x2)
2303
2303
0 1
2304
2304
1 3
0 commit comments