小编Ano*_*ous的帖子

如何访问python中矩阵每个元素的相邻单元格?

如果两个单元共享边界,则认为它们相邻。例如 :

A = 5 6 4
    2 1 3
    7 9 8
Run Code Online (Sandbox Code Playgroud)

这里索引 0,0 的相邻元素位于索引 [0,1] 和 [1,0] 处,对于索引 1,1,相邻元素位于索引 [0,1],[1,0],[2,1] ] 和 [1,2]。

python algorithm implementation numpy python-3.x

1
推荐指数
1
解决办法
4218
查看次数

标签 统计

algorithm ×1

implementation ×1

numpy ×1

python ×1

python-3.x ×1