ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

NumPy - numpy.argmax

2021-11-14 23:31:49  阅读:220  来源: 互联网

标签:argmax numpy 索引 shape array NumPy axis


NumPy - numpy.argmax

NumPy Manual
https://numpy.org/doc/stable/index.html

numpy.argmax
https://numpy.org/doc/stable/reference/generated/numpy.argmax.html

1. numpy.argmax

numpy.argmax(a, axis=None, out=None)

Returns the indices of the maximum values along an axis.
返回沿轴的最大值的索引。

Parameters

a: array_like
Input array.

axis: int, optional
By default, the index is into the flattened array, otherwise along the specified axis.
默认情况下,索引位于扁平数组中,否则沿指定轴。

out: array, optional
If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.
如果提供,结果将被插入到这个数组中。 它应该具有适当的 shape and dtype。

Returns

index_array: ndarray of ints
Array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.
数组中的索引数组。它具有与 a.shape 相同的形状,但沿轴的维度已被移除。

1.1 Notes

In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence are returned.
如果最大值出现多次,则返回第一次出现对应的索引。

1.2 Examples

References

https://numpy.org/doc/stable/reference/generated/numpy.argmax.html

标签:argmax,numpy,索引,shape,array,NumPy,axis
来源: https://blog.csdn.net/chengyq116/article/details/121323744

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有