- 用法:- Series.idxmax(axis=0, skipna=True, *args, **kwargs)
- 返回最大值的行标签。 - 如果多个值等于最大值,则返回具有该值的第一行标签。 - axis:整数,默认 0
- 为了与 DataFrame.idxmax 兼容。为系列上的应用程序提供冗余。 
- skipna:布尔值,默认为真
- 排除 NA/空值。如果整个系列为 NA,则结果将为 NA。 
- *args, **kwargs:
- 其他参数和关键字无效,但可能会被接受以与 NumPy 兼容。 
 
- index
- 最大值的标签。 
 
- ValueError
- 如果系列为空。 
 
 - 参数:- 返回:- 抛出:- 注意:- 此方法是 - ndarray.argmax的系列版本。此方法返回最大值的标签,而- ndarray.argmax返回位置。要获得该位置,请使用- series.values.argmax()。- 例子:- >>> s = pd.Series(data=[1, None, 4, 3, 4], ... index=['A', 'B', 'C', 'D', 'E']) >>> s A 1.0 B NaN C 4.0 D 3.0 E 4.0 dtype:float64- >>> s.idxmax() 'C'- 如果 - skipna为 False 并且数据中有 NA 值,则函数返回- nan。- >>> s.idxmax(skipna=False) nan
相关用法
- Python pandas.Series.idxmin用法及代码示例
- Python pandas.Series.iat用法及代码示例
- Python pandas.Series.isna用法及代码示例
- Python pandas.Series.iteritems用法及代码示例
- Python pandas.Series.isnull用法及代码示例
- Python pandas.Series.iloc用法及代码示例
- Python pandas.Series.interpolate用法及代码示例
- Python pandas.Series.info用法及代码示例
- Python pandas.Series.items用法及代码示例
- Python pandas.Series.isin用法及代码示例
- Python pandas.Series.infer_objects用法及代码示例
- Python pandas.Series.add_prefix用法及代码示例
- Python pandas.Series.map用法及代码示例
- Python pandas.Series.max用法及代码示例
- Python pandas.Series.str.isdecimal用法及代码示例
- Python pandas.Series.str.get用法及代码示例
- Python pandas.Series.to_csv用法及代码示例
- Python pandas.Series.dt.day_name用法及代码示例
- Python pandas.Series.sample用法及代码示例
- Python pandas.Series.head用法及代码示例
注:本文由纯净天空筛选整理自pandas.pydata.org大神的英文原创作品 pandas.Series.idxmax。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
