pandas.Index.max — pandas 1.0.1 documentation (original) (raw)

Index. max(self, axis=None, skipna=True, *args, **kwargs)[source]

Return the maximum value of the Index.

Parameters

axisint, optional

For compatibility with NumPy. Only 0 or None are allowed.

skipnabool, default True

Returns

scalar

Maximum value.

Examples

idx = pd.Index([3, 2, 1]) idx.max() 3

idx = pd.Index(['c', 'b', 'a']) idx.max() 'c'

For a MultiIndex, the maximum is determined lexicographically.

idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)]) idx.max() ('b', 2)