如何在y = -x轴上镜像numpy矩阵?

时间:2019-01-22 21:35:14

标签: python arrays numpy mirror

伪装我有一个numpy数组,其上装有矢量,如下所示:

import numpy as np

a = np.array([0, 1, 2, 3],
             [0, 0, 4, 5],
             [0, 0, 0, 6],
             [0, 0, 0, 0])

如何在y=-x轴上镜像该数组以使其看起来像这样?

>>a
[[0, 1, 2, 3],
 [1, 0, 4, 5],
 [2, 4, 0, 6],
 [3, 5, 6, 0]]

0 个答案:

没有答案