Python 切片获取数组特定行和列数据
a = [[9, 9, 4], [8, 8, 1], [5, 3, 6], [3, 3, 3], [2, 1, 9]]
result = [row[1:3] for row in a[0:2]] print(result)
原文地址: https://www.cveoy.top/t/topic/o8bY 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
a = [[9, 9, 4], [8, 8, 1], [5, 3, 6], [3, 3, 3], [2, 1, 9]]
result = [row[1:3] for row in a[0:2]] print(result)
原文地址: https://www.cveoy.top/t/topic/o8bY 著作权归作者所有。请勿转载和采集!