矩阵Python的垂直列表
如果没有numpy,请额外的库和类(如果可能的话)。我想列出矩阵的垂直线列表,以影响真正的矩阵。
matrix = [[1,2,3],
[4,5,6],
[7,8,9]
]
vertical = [[1,4,7],
[2,5,8],
[3,6,9]]
vertical[0][1] = 9
print(matrix)
>>> [[1,2,3],
[9,5,6],
[7,8,9]]
without numpy, additional library and classes (if possible). I want to make a list of vertical lines of matrix which effects the real matrix.
matrix = [[1,2,3],
[4,5,6],
[7,8,9]
]
vertical = [[1,4,7],
[2,5,8],
[3,6,9]]
vertical[0][1] = 9
print(matrix)
>>> [[1,2,3],
[9,5,6],
[7,8,9]]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有图书馆或课程就无法做到。
但是,您可以做类似的事情:
I don't think that you can do it without Libraries or classes.
But, you can do something like: