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. php对象怎么拆分字符串数组,在PHP中将字符串拆分为Unicode字符数组的最佳方法是什么?...
  2. [JS-BOM]BOM概念与组成
  3. IntelliJ Idea 常用快捷键 (经过测试)
  4. LXC基本架构及用法(六)
  5. HyperVolume多目标评价指标概述
  6. seo伪原创/百度链接推送/原创检测工具,python超简单POST案例
  7. kdj的matlab代码,8个字符的Kdj股票技术指标公式源代码(插图)
  8. 计算机无法同步,在win7中,为什么电脑时间不能同步?
  9. USB转RS422/485/232串口线异常问题记录
  10. c语言快捷键的使用方法,电脑快捷键的使用方法
  11. 人工智能导论测试题——第六章 进化智能与群体智能(2)
  12. Excel2010 count,countif,countifs使用
  13. 几种求函数最值的算法
  14. 安卓bmi项目_bmi计算器
  15. 算法--分治法归并排序 python
  16. 【2019蓝桥杯国赛B组】排列数
  17. Emacs User's Guide
  18. android项目实战博学谷百度云,Android项目实战系列—基于博学谷(七)课程模块(下)...
  19. 每日英语:China's Conflicted Consumers
  20. IT人的学习方法论---一定要沉淀成自己的

热门文章

  1. 2016年,这50家创业公司将真正改变世界
  2. SAP的成本中心与利润中心的关系
  3. 库存管理-历史库存和收发存系列-MB5B
  4. 把SAP里的负号放到前面来的函数
  5. Web Dynpro for ABAP 之 Web Dynpro Window Web Dynpro Application
  6. AgilePoint模型驱动BPM(业务流程管理)介绍
  7. ABAP 的TABLE CONTROL实践积累
  8. 刷抖音对手机有什么要求_6频段全面5G手机 nova6 5G成新年换机最佳之选
  9. ckeditor4 php,CKEditor 4自定义下拉列表
  10. java迷宫生成代码_通过深度优先搜索产生的迷宫的Java代码