maxframe.dataframe.Series.argmax#

Series.argmax(axis=0, skipna=True, *args, **kwargs)#

返回 Series 中最小值的整数位置。

如果最大值出现在多个位置,则返回第一个行位置。

参数:
  • axis ({None}) -- 未使用。该参数是为了与 DataFrame 兼容而需要的。

  • skipna (bool, default True) -- 显示结果时排除 NA/null 值。

  • *args -- 与 NumPy 兼容的附加参数和关键字。

  • **kwargs -- 与 NumPy 兼容的附加参数和关键字。

返回:

最大值的行位置。

返回类型:

int

参见

Series.argmin

返回最小值的位置。

Series.argmax

返回最大值的位置。

maxframe.tensor.argmax

等效于张量的方法。

Series.idxmax

返回最大值的索引标签。

Series.idxmin

返回最小值的索引标签。

示例

考虑包含谷物热量的数据集

>>> import maxframe.dataframe as md
>>> s = md.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
...                'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s.execute()
Corn Flakes              100.0
Almond Delight           110.0
Cinnamon Toast Crunch    120.0
Cocoa Puff               110.0
dtype: float64
>>> s.argmax().execute()
2
>>> s.argmin().execute()
0

由于 Series 是从零开始索引的,因此最大谷物热量是第三个元素,最小谷物热量是第一个元素。