Skip to content

Commit 599c421

Browse files
authored
Reordered doc-string sections for combine & combine_first
Followed link : https://numpydoc.readthedocs.io/en/latest/format.html#sections
1 parent 948d5da commit 599c421

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pandas/core/series.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -2289,6 +2289,11 @@ def combine(self, other, func, fill_value=None):
22892289
Series
22902290
The result of combining the Series with the other object.
22912291
2292+
See Also
2293+
--------
2294+
Series.combine_first : Combine Series values, choosing the calling
2295+
Series' values first.
2296+
22922297
Examples
22932298
--------
22942299
>>> s1 = pd.Series([1, 2])
@@ -2312,11 +2317,6 @@ def combine(self, other, func, fill_value=None):
23122317
2 787
23132318
dtype: int64
23142319
2315-
See Also
2316-
--------
2317-
Series.combine_first : Combine Series values, choosing the calling
2318-
Series' values first.
2319-
23202320
"""
23212321
if fill_value is None:
23222322
fill_value = na_value_for_dtype(self.dtype, compat=False)
@@ -2364,16 +2364,7 @@ def combine_first(self, other):
23642364
Returns
23652365
-------
23662366
combined : Series
2367-
2368-
Examples
2369-
--------
2370-
>>> s1 = pd.Series([1, np.nan])
2371-
>>> s2 = pd.Series([3, 4])
2372-
>>> s1.combine_first(s2)
2373-
0 1.0
2374-
1 4.0
2375-
dtype: float64
2376-
2367+
23772368
See Also
23782369
--------
23792370
Series.combine : Perform elementwise operation on two Series
@@ -2383,6 +2374,15 @@ def combine_first(self, other):
23832374
-----
23842375
Result index will be the union of the two indexes.
23852376
2377+
Examples
2378+
--------
2379+
>>> s1 = pd.Series([1, np.nan])
2380+
>>> s2 = pd.Series([3, 4])
2381+
>>> s1.combine_first(s2)
2382+
0 1.0
2383+
1 4.0
2384+
dtype: float64
2385+
23862386
"""
23872387
new_index = self.index.union(other.index)
23882388
this = self.reindex(new_index, copy=False)

0 commit comments

Comments
 (0)