Skip to content

Commit 34649f2

Browse files
juanhuguetgarciaTomAugspurger
authored andcommitted
DOC: improved the docstring of pandas.Index.min() (#20140)
1 parent acb3fd7 commit 34649f2

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

pandas/core/base.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,35 @@ def argmax(self, axis=None):
830830
return nanops.nanargmax(self.values)
831831

832832
def min(self):
833-
""" The minimum value of the object """
833+
"""
834+
Return the minimum value of the Index.
835+
836+
Returns
837+
-------
838+
scalar
839+
Minimum value.
840+
841+
See Also
842+
--------
843+
Index.max : Return the maximum value of the object.
844+
Series.min : Return the minimum value in a Series.
845+
DataFrame.min : Return the minimum values in a DataFrame.
846+
847+
Examples
848+
--------
849+
>>> idx = pd.Index([3, 2, 1])
850+
>>> idx.min()
851+
1
852+
853+
>>> idx = pd.Index(['c', 'b', 'a'])
854+
>>> idx.min()
855+
'a'
856+
857+
For a MultiIndex, the minimum is determined lexicographically.
858+
>>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
859+
>>> idx.min()
860+
('a', 1)
861+
"""
834862
return nanops.nanmin(self.values)
835863

836864
def argmin(self, axis=None):

0 commit comments

Comments
 (0)