簡體   English   中英

如何從二維數組中返回每個元素的行索引?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM