[英]How to zip each element from a 1D array with the elements from each row of a 2D array?
[英]How to return the row index of each element from a 2D array?
我有一個 8x10 二維數組 A。我需要另一個只存儲 A 的每個元素的行索引的二維數組。我 go 如何這樣做? 感謝你的幫助!
我想我明白了!
C = np.array(np.where(A))[0].reshape(10, 8)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.