numpy:找到指定元素的索引示例
时间:2021-05-05 15:36:27|栏目:Python代码|点击: 次
目的:在numpy数组中知道指定元素的索引
函数: np.argwhere
>>>x >>>array([[0, 1, 2], [3, 4, 5]]) >>>np.argwhere(x>1) >>>array([[0, 2], [1, 0], [1, 1], [1, 2]])
上一篇:Python实现判断一个字符串是否包含子串的方法总结
栏 目:Python代码
本文标题:numpy:找到指定元素的索引示例
本文地址:http://www.codeinn.net/misctech/115152.html






