【发布时间】:2018-08-30 08:46:15
【问题描述】:
从这些数组中:
t = ["A","B","C"]
a = [1,2,3]
b = [4,5,6]
c = [7,8,9]
如何获得这样的列表
[
{ 'A':1, 'B':4, 'C':7},
{ 'A':2, 'B':5, 'C':8},
{ 'A':3, 'B':6, 'C':9},
]
所以转储到 JSON 中更有用?
【问题讨论】:
-
可能值得将数组 a,b,c 存储在命名元组中。
标签: python arrays dictionary elementwise-operations