0
什麼是在python中索引1d數組變量的過程?如何索引1d數組沒有單身維度在Python中由1d數組與單身維數?
例如,請考慮下面的例子:
a = np.ones(100)
b = np.ones(100, 1)
a[b > 0]
IndexError Traceback (most recent call last)
<ipython-input-14-05e3ddce24c9> in <module>()
----> 1 a[b == 1]
IndexError: too many indices for array
我怎麼會做這樣的索引,而無需創建一個新的數組?