Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重新格式化Python';将向量列表结果转换为单个逗号分隔的结果_Python_Arrays_Regex - Fatal编程技术网

重新格式化Python';将向量列表结果转换为单个逗号分隔的结果

重新格式化Python';将向量列表结果转换为单个逗号分隔的结果,python,arrays,regex,Python,Arrays,Regex,如何将向量数组(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,

如何将向量数组(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
有人吗


提前谢谢你

简单的方法是使用两个for循环

for d in data:
    s = ''
    for l in d:
        s += l + ', '
    print(s[:-2])

您正在尝试创建字符串列表吗?做:

[', '.join(sublist) for sublist in data]