Skip to content

Commit acb3fd7

Browse files
JoanMartinTomAugspurger
authored andcommitted
DOC: Docstring for pandas.index.max (#20130)
1 parent c79e622 commit acb3fd7

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

pandas/core/base.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,36 @@ def empty(self):
787787
return not self.size
788788

789789
def max(self):
790-
""" The maximum value of the object """
790+
"""
791+
Return the maximum value of the Index.
792+
793+
Returns
794+
-------
795+
scalar
796+
Maximum value.
797+
798+
See Also
799+
--------
800+
Index.min : Return the minimum value in an Index.
801+
Series.max : Return the maximum value in a Series.
802+
DataFrame.max : Return the maximum values in a DataFrame.
803+
804+
Examples
805+
--------
806+
>>> idx = pd.Index([3, 2, 1])
807+
>>> idx.max()
808+
3
809+
810+
>>> idx = pd.Index(['c', 'b', 'a'])
811+
>>> idx.max()
812+
'c'
813+
814+
For a MultiIndex, the maximum is determined lexicographically.
815+
816+
>>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
817+
>>> idx.max()
818+
('b', 2)
819+
"""
791820
return nanops.nanmax(self.values)
792821

793822
def argmax(self, axis=None):

0 commit comments

Comments
 (0)