1. 程式人生 > 實用技巧 >碎片篇——np.where()和np.argwhere()用法總結

碎片篇——np.where()和np.argwhere()用法總結

np.where()

在這裡插入圖片描述

np.argwhere()

Find the indices of array elements that are non-zero, grouped by element.
返回非0的陣列元組的索引,其中a是要索引陣列的條件。
在這裡插入圖片描述
返回陣列中所有大於1的數字的索引值。