list of lists to csv

list of lists to csv_第1张图片
image

a_list is a list of lists.which has already cleaned from drity.

a_list = [
[a,b,c],
[c,d,e]
]# b_list = [a,b,c]

now want change a_list to a csv file.

list of lists to csv_第2张图片
image

open w+b model cause a error ....sub_list is not 'str' .

if don't use the lineterminator, the new csvfile will appear empty line.

ifa_list is not list of lists is better use open wb model, that can avoide the space or empty line.

你可能感兴趣的:(list of lists to csv)