def argmax(a, axis=None, out=None):"""Returns the indices of the maximum values along an axis.返回沿轴的最大值的索引。Parameters----------a : array_likeInput array.输入数组。axis : int, optionalBy default, the index is into the flattened array, otherwisealong the specified axis.默认情况下,索引位于平面数组中(就是直接把数组摊开,没有轴的概念),否则沿指定的轴。out : array, optionalIf provided, the result will be inserted into this array. It shouldbe of the appropriate shape and dtype.如果提供,结果将被插入此数组。 它应该具有适当的形状和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”相同,但沿“轴”的尺寸已删除。See Also--------ndarray.argmax, argminamax : The maximum value along a given axis.unravel_index : Convert a flat index into an index tuple.Notes-----In case of multiple occurrences of the maximum values, the indicescorresponding to the first occurrence are returned.在多次出现最大值的情况下,返回对应于第一次出现的索引。Examples-------->>> a = np.arange(6).reshape(2,3)>>> aarray([[0, 1, 2],[3, 4, 5]])>>> np.argmax(a)5>>> np.argmax(a, axis=0)array([1, 1, 1])>>> np.argmax(a, axis=1)array([2, 2])Indexes of the maximal elements of a N-dimensional array:N维数组的最大元素的索引:>>> ind = np.unravel_index(np.argmax(a, axis=None), a.shape)>>> ind(1, 2)>>> a[ind]5>>> b = np.arange(6)>>> b[1] = 5>>> barray([0, 5, 2, 3, 4, 5])>>> np.argmax(b)  # Only the first occurrence is returned. 仅返回第一个匹配项。1"""return _wrapfunc(a, 'argmax', axis=axis, out=out)

python numpy np.argmax(a, axis=None, out=None) (按给定轴位比较,返回第一个最大值索引【下标】)相关推荐

  1. python numpy np.fromstring()函数(从字符串文本中提取数字,返回一维数组)(爬虫提取数字挺好用的)

    from numpy\core\multiarray.py def fromstring(string, dtype=None, count=-1, sep=''): # real signature ...

  2. python numpy np.argsort()(返回将对数组进行排序的索引)(不懂区别?)

    from numpy\core\fromnumeric.py @array_function_dispatch(_argsort_dispatcher) def argsort(a, axis=-1, ...

  3. python numpy np.lexsort()(使用键序列执行间接稳定排序)(具体没太搞懂区别?)

    from numpy\core_multiarray_umath.py @array_function_from_c_func_and_dispatcher(_multiarray_umath.lex ...

  4. (python numpy) np.array.shape 中 (3,)、(3,1)、(1,3)的区别

    (python numpy) np.array.shape 中 (3,).(3,1).(1,3)的区别 被人问到这个问题,就记录一下吧 1. (3,) (3,)是[x,y,z][x,y,z][x,y, ...

  5. python numpy之argmax()方法理解

    1.numpy之argmax()作用 返回相应维度axis上的最大值的位置. 2.具体应用 深度学习图像分割多分类最后是softmax得分结果,我们需要将这个浮点型的结果保存成整型的标签图像,这样才算 ...

  6. Python中np.sum()对axis的个人理解,超详细

    你们讨论的axis=0和1并不是简单的行和列,axis=0表示的是第一个维度,在第一个维度上的元素间进行求和.比较大小,axis=1表示的是第二个维度,在第二个维度上的元素间进行求和.比较大小.一个维 ...

  7. python numpy np.finfo()函数 eps

    用法 finfo函数是根据括号中的类型来获得信息,获得符合这个类型的数型 例1: import numpy as np a=np.array([[1],[2],[-1],[0]]) b=np.maxi ...

  8. [转载] python numpy np.finfo()函数 eps

    参考链接: Python中的numpy.log2 用法 finfo函数是根据括号中的类型来获得信息,获得符合这个类型的数型 例1: import numpy as np a=np.array([[1] ...

  9. [转载] python numpy np.exp()函数

    参考链接: Python中的numpy.exp def exp(x, *args, **kwargs): # real signature unknown; NOTE: unreliably rest ...

最新文章

  1. Ecshop文章列表页显示内容摘要
  2. 2个点马氏距离计算实例_数据分析基础:距离度量方式(欧式距离、马氏距离、曼哈顿距离)...
  3. 超纯超美的曲线(Peter De Jong Attractor)
  4. [How TO]-堡垒机快捷登陆SSH服务器-expect自动输密码
  5. mysql select 缓存_mysql select缓存机制使用详解
  6. C语言各种变量的初始化
  7. 邮件excel html,小数点分隔符在电子邮件(HTML/CSS)在Excel的VBA编程
  8. iBATIS.net获取运行时sql语句
  9. 马尔科夫随机场之图像去燥【Matlab实现,PRML例子】
  10. codeigniter 操作 图标
  11. ArcGIS API For Javascript :如何动态生成 token 加载权限分配的地图服务?
  12. 微软请你学Linux第三季: 6月最后的约会,再次诚意邀请!
  13. Data truncation: Out of range value for column ‘quanity‘ at row 问题解决方案
  14. unity 模型销毁_Unity GameObject 销毁(Destroy)后的几种状态
  15. [Canvas]空战游戏进阶 增加己方子弹管理类
  16. 在向服务器发送请求时发生传输级错误。
  17. windows安装补丁慢 360安全卫士和腾讯电脑管家安装同样卡住 解决办法
  18. java quartz插件_JFinal Quartz 2.2.1插件
  19. MPQ文档布局分析[转帖]
  20. Linux环境下右键无法新建文档的解决方法——Ubuntu 16.x

热门文章

  1. 数据结构哪本书比较好_东莞工厂电动伸缩门固定在哪一边比较好?
  2. 【学习笔记】利润中心会计初识
  3. SAP中如何更改供应商账户组
  4. CNZZ数据专家使用方法?
  5. 如何导出SAP的数据表字段和字段描述
  6. VAT code VAT NO.
  7. 关于SmartForm和ScriptForm的输出格式设置说明(转载)
  8. 永洪Desktop自由表格间计算使用教程
  9. 在线婚恋为何成了一门丧生意
  10. 信息服务器怎么填写,如何设定服务器信息