【发布时间】:2021-12-24 09:00:01
【问题描述】:
假设我有以下 numpy 二维数组,其中arr[2,0] = 7。
arr =
[[1 2 3]
[4 5 6]
[7 8 9]]
如何实现环绕效果,例如,当我尝试检索 arr[3,0] 时,我不会得到 "index 3 is out of the bounds for axis 0尺寸为 3 英寸,但会得到arr[0,0] = 1 作为回报?
谢谢!
【问题讨论】:
标签: python numpy numpy-ndarray