np.argwhere( a )

np.argwhere( a )

Find the indices of array elements that are non-zero, grouped by element.

返回非0的数组元组的索引,其中a是要索引数组的条件。

返回数组中所有大于1的数字的索引值。

来源:https://blog.csdn.net/u012193416/article/details/79672514

原文地址:https://www.cnblogs.com/ArdenWang/p/15357188.html