pandas.Index.max#

Index.max(axis=None, skipna=True, *args, **kwargs)[源代码]#

返回索引的最大值。

参数
axis整型,可选

与NumPy的兼容性。只允许0或不允许。

skipna布尔值,默认为True

显示结果时排除NA/NULL值。

*args, ** 科瓦格人

与NumPy兼容的其他参数和关键字。

退货
标量

最大值。

参见

Index.min

返回索引中的最小值。

Series.max

返回级数中的最大值。

DataFrame.max

返回DataFrame中的最大值。

示例

>>> idx = pd.Index([3, 2, 1])
>>> idx.max()
3
>>> idx = pd.Index(['c', 'b', 'a'])
>>> idx.max()
'c'

对于多索引,最大值按词典顺序确定。

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