pandas.Index.max#
- Index.max(axis=None, skipna=True, *args, **kwargs)[源代码]#
返回索引的最大值。
- Parameters:
- axisint, optional
为了与NumPy兼容。只允许0或None。
- <strong>skipna</strong>bool, default True
在显示结果时排除 NA/null 值。
- *args, **kwargs
用于与 NumPy 兼容的附加参数和关键字。
- Returns:
- scalar
最大值。
参见
Index.min返回Index中的最小值。
Series.max返回Series中的最大值。
DataFrame.max返回DataFrame中的最大值。
Examples
>>> idx = pd.Index([3, 2, 1]) >>> idx.max() 3
>>> idx = pd.Index(['c', 'b', 'a']) >>> idx.max() 'c'
对于MultiIndex,最大值是按字典顺序确定的。
>>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)]) >>> idx.max() ('b', 2)