我如何reformat
将矢量数组(Python)的结果分隔为单个逗号?
我有这些结果:
[ ['44231#0:', '2016/10/11', '11:19:23', '11:19:23', '1', '11:19:24', '11:19:24'
, '0']
['44231#0:', '2016/10/11', '12:20:39', '12:20:58', '12:20:59', '12:20:59', '0']
]
我需要这样的东西:
44231#0:, 2016/10/11, 11:19:23, 11:19:23, 1, 11:19:24, 11:19:24
44231#0:, 2016/10/11, 12:20:39, 12:20:58, 12:20:59, 12:20:59, 0
任何?
提前谢谢!!
答案 0 :(得分:1)
简单的方法是使用两个for循环。
for d in data:
s = ''
for l in d:
s += l + ', '
print(s[:-2])
答案 1 :(得分:0)
您是否正在尝试制作字符串列表?做:
[', '.join(sublist) for sublist in data]