python中怎样对多维数组的某一维求和,放在新的数组中

如题所述

第1个回答  2017-08-08
a = [[1, 2, 3], [4, 5, 6]]
new_a = [sum(i) for i in a]

相似回答