【发布时间】:2017-04-11 18:10:50
【问题描述】:
我有一个数字矩阵:
[[a, b, c]
[d, e, f]
[g, h, i]]
我希望得到相应的镜像:
[[g, h, i]
[d, e, f]
[a, b, c]
[d, e, f]
[g, h, i]]
然后再次屈服:
[[i, h, g, h, i]
[f, e, d, e, f]
[c, b, a, b, c]
[f, e, d, e, f]
[i, h, g, h, i]]
我想坚持使用基本的 Python 包,比如 numpy。提前感谢您的帮助!
【问题讨论】:
-
有很多方法可以做到这一点,到目前为止你尝试了什么?
-
列表推导是你的朋友。
标签: python arrays python-3.x numpy matrix