Skip to content

Commit e1129b1

Browse files
Todd DeLucawesm
Todd DeLuca
authored andcommitted
Show idxmin behavior for multiple min values.
1 parent 845254d commit e1129b1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/source/basics.rst

+9
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ index labels with the minimum and maximum corresponding values:
369369
df1.idxmin(axis=0)
370370
df1.idxmax(axis=1)
371371
372+
When there are multiple rows (or columns) matching the minimum or maximum
373+
value, ``idxmin`` and ``idxmax`` return the first matching index:
374+
375+
.. ipython:: python
376+
377+
df = DataFrame([2, 1, 1, 3, np.nan], columns=['A'], index=list('edcba'))
378+
df
379+
df['A'].idxmin()
380+
372381
Value counts (histogramming)
373382
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
374383

0 commit comments

Comments
 (0)