numpy.ma.argmax#
- ma.argmax(self, axis=None, fill_value=None, out=None) = <numpy.ma.core._frommethod object>#
返回给定轴上最大值的索引数组. 掩码值被视为具有 fill_value 值.
- 参数:
- axis{None, integer}
如果为 None,则索引指向扁平化数组,否则沿指定的轴
- fill_value标量或 None,可选
用于填充掩码的值.如果为 None,则使用 maximum_fill_value(self._data) 的输出.
- out{None, array}, optional
可用于放置结果的数组. 它的类型被保留,并且它必须具有正确的形状才能容纳输出.
- 返回:
- index_array{integer_array}
示例
>>> import numpy as np >>> a = np.arange(6).reshape(2,3) >>> a.argmax() 5 >>> a.argmax(0) array([1, 1, 1]) >>> a.argmax(1) array([2, 2])