How to find which axes will be collapsed during indexing a Numpy array?

前端 未结 0 1361
执念已碎
执念已碎 2020-12-11 19:21

for example:

a = np.zeros((4, 3, 2, 1))
index = (slice(0, 2, 1), 0, ...)
# a[index].shape is (2, 2, 1)

The axis 1 (second axis) of a

相关标签:
回答
  • 消灭零回复
提交回复
热议问题