Skip to content

Commit 8c928f5

Browse files
committed
Reordered doc-string sections for combine & combine_first
Followed link : https://numpydoc.readthedocs.io/en/latest/format.html#sections
1 parent 0a00632 commit 8c928f5

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
@@ -2308,6 +2308,11 @@ def combine(self, other, func, fill_value=None):
23082308
Series
23092309
The result of combining the Series with the other object.
23102310
2311+
See Also
2312+
--------
2313+
Series.combine_first : Combine Series values, choosing the calling
2314+
Series' values first.
2315+
23112316
Examples
23122317
--------
23132318
>>> s1 = pd.Series([1, 2])
@@ -2331,11 +2336,6 @@ def combine(self, other, func, fill_value=None):
23312336
2 787
23322337
dtype: int64
23332338
2334-
See Also
2335-
--------
2336-
Series.combine_first : Combine Series values, choosing the calling
2337-
Series' values first.
2338-
23392339
"""
23402340
if fill_value is None:
23412341
fill_value = na_value_for_dtype(self.dtype, compat=False)
@@ -2387,16 +2387,7 @@ def combine_first(self, other):
23872387
Returns
23882388
-------
23892389
combined : Series
2390-
2391-
Examples
2392-
--------
2393-
>>> s1 = pd.Series([1, np.nan])
2394-
>>> s2 = pd.Series([3, 4])
2395-
>>> s1.combine_first(s2)
2396-
0 1.0
2397-
1 4.0
2398-
dtype: float64
2399-
2390+
24002391
See Also
24012392
--------
24022393
Series.combine : Perform elementwise operation on two Series
@@ -2406,6 +2397,15 @@ def combine_first(self, other):
24062397
-----
24072398
Result index will be the union of the two indexes.
24082399
2400+
Examples
2401+
--------
2402+
>>> s1 = pd.Series([1, np.nan])
2403+
>>> s2 = pd.Series([3, 4])
2404+
>>> s1.combine_first(s2)
2405+
0 1.0
2406+
1 4.0
2407+
dtype: float64
2408+
24092409
"""
24102410
new_index = self.index.union(other.index)
24112411
this = self.reindex(new_index, copy=False)

0 commit comments

Comments
 (0)