Skip to content

Commit 63e8527

Browse files
ghasemnaddafjorisvandenbossche
authored andcommitted
DOC: clarify idxmax behaviour issue pandas-dev#18206 (pandas-dev#18209)
1 parent ef4e30b commit 63e8527

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
@@ -5805,7 +5805,12 @@ def idxmin(self, axis=0, skipna=True):
58055805
0 or 'index' for row-wise, 1 or 'columns' for column-wise
58065806
skipna : boolean, default True
58075807
Exclude NA/null values. If an entire row/column is NA, the result
5808-
will be NA
5808+
will be NA.
5809+
5810+
Raises
5811+
------
5812+
ValueError
5813+
* If the row/column is empty
58095814
58105815
Returns
58115816
-------
@@ -5836,7 +5841,12 @@ def idxmax(self, axis=0, skipna=True):
58365841
0 or 'index' for row-wise, 1 or 'columns' for column-wise
58375842
skipna : boolean, default True
58385843
Exclude NA/null values. If an entire row/column is NA, the result
5839-
will be first index.
5844+
will be NA.
5845+
5846+
Raises
5847+
------
5848+
ValueError
5849+
* If the row/column is empty
58405850
58415851
Returns
58425852
-------

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)