Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个二维数组来表示多对多映射:
0 3 1 3 3 0 0 0 1 0 0 0 3 0 0 0
将与此数组中的特定索引相对应的行和列条目“归零”的最快方法是什么?
arr[i] = 0 # zeroes out row i arr[:,i] = 0 # zeroes out column i