Skip to content

Commit c0e4acd

Browse files
ghasemnaddafTomAugspurger
authored andcommitted
DOC: clarify idxmax behaviour issue #18206 (#18209)
(cherry picked from commit 63e8527)
1 parent 1a09eb5 commit c0e4acd

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

pandas/core/frame.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -5813,7 +5813,12 @@ def idxmin(self, axis=0, skipna=True):
58135813
0 or 'index' for row-wise, 1 or 'columns' for column-wise
58145814
skipna : boolean, default True
58155815
Exclude NA/null values. If an entire row/column is NA, the result
5816-
will be NA
5816+
will be NA.
5817+
5818+
Raises
5819+
------
5820+
ValueError
5821+
* If the row/column is empty
58175822
58185823
Returns
58195824
-------
@@ -5844,7 +5849,12 @@ def idxmax(self, axis=0, skipna=True):
58445849
0 or 'index' for row-wise, 1 or 'columns' for column-wise
58455850
skipna : boolean, default True
58465851
Exclude NA/null values. If an entire row/column is NA, the result
5847-
will be first index.
5852+
will be NA.
5853+
5854+
Raises
5855+
------
5856+
ValueError
5857+
* If the row/column is empty
58485858
58495859
Returns
58505860
-------

pandas/core/series.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,13 @@ def idxmin(self, axis=None, skipna=True, *args, **kwargs):
13061306
Parameters
13071307
----------
13081308
skipna : boolean, default True
1309-
Exclude NA/null values
1309+
Exclude NA/null values. If the entire Series is NA, the result
1310+
will be NA.
1311+
1312+
Raises
1313+
------
1314+
ValueError
1315+
* If the Series is empty
13101316
13111317
Returns
13121318
-------
@@ -1336,7 +1342,13 @@ def idxmax(self, axis=None, skipna=True, *args, **kwargs):
13361342
Parameters
13371343
----------
13381344
skipna : boolean, default True
1339-
Exclude NA/null values
1345+
Exclude NA/null values. If the entire Series is NA, the result
1346+
will be NA.
1347+
1348+
Raises
1349+
------
1350+
ValueError
1351+
* If the Series is empty
13401352
13411353
Returns
13421354
-------

0 commit comments

Comments
 (0)