numpy np.argwhere

没有找到与「numpy np.argwhere」相关的内容

AI 回答 由 glm-4-flash 生成 · 仅供参考,请自行核实
1. 功能:`numpy.argwhere` 函数用于返回输入数组中元素的非零索引。
2. 返回值:返回一个二维数组,其中包含输入数组中每个非零元素的索引。
3. 示例代码:

import numpy as np

arr = np.array([[0, 1, 0], [0, 0, 3], [4, 0, 0]])
indices = np.argwhere(arr)
print(indices)

输出:

[[1 0]
[2 2]
[0 1]]
没有找到「numpy np.argwhere」相关的内容

建议:检查关键词是否有错别字,或换一个更常见的说法。