numpy.nonzero
来源:互联网 发布:python中re.search 编辑:程序博客网 时间:2024/06/05 19:13
Return the indices of the elements that are non-zero.
Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension. The corresponding non-zero values can be obtained with:
To group the indices by element, rather than dimension, use:
The result of this is always a 2-D array, with a row for each non-zero element.
a : array_like
Input array.
tuple_of_arrays : tuple
Indices of elements that are non-zero.
See also
- flatnonzero
- Return indices that are non-zero in the flattened version of the input array.
- ndarray.nonzero
- Equivalent ndarray method.
- count_nonzero
- Counts the number of non-zero elements in the input array.
Examples
A common use for nonzero is to find the indices of an array, where a condition is True. Given an array a, the condition a > 3 is a boolean array and since False is interpreted as 0, np.nonzero(a > 3) yields the indices of the a where the condition is true.
The nonzero method of the boolean array can also be called.
- numpy.nonzero
- numpy nonzero
- numpy nonzero使用方法
- python numpy.nonzero
- numpy.nonzero函数
- numpy——nonzero
- numpy.nonzero()函数()
- numpy nonzero的用法
- numpy中的nonzero()
- Numpy.nonzero() 详解 numpy module中 nonzero()函数
- numpy中的nonzero()的用法
- numpy中的nonzero()的用法
- numpy中nonzero()的用法
- python中numpy.nonzero()用法
- python numpy中nonzero()的用法
- python numpy中nonzero()的用法
- python numpy中nonzero()的用法
- python numpy中nonzero()的用法
- ubuntu pycharm去掉波浪线
- MySQL下实现闪回的设计思路 (MySQL Flashback Feature)
- HBase备份之导入导出
- personal pic
- xhEditor实现插入代码功能
- numpy.nonzero
- nginx使用指南
- POJ 3616 Milking Time DP题解
- 黑马程序员——高新技术之泛型
- 单独一个文件
- 三字经
- opengl 矩阵变换
- 使用Memory Analyzer tool(MAT)分析内存泄漏(一)
- HDOJ题目1171Big Event in HDU(多重背包)