numpy代码:
import numpy as np
a = np.random.randn(3000,300,13)
print(a[[0],:,[0,1]].shape)
结果:
(2, 300)
但是我想要的是:
(1,300,2)
另一个代码:
import numpy as np
a = np.random.randn(3000,300,13)
print(a[[0,1,2],:,[0,1]].shape)
结果:
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (3,) (2,)
但是我想要的是:
(3,300,2)