我的数据结构如下:
['1404407396000',
'484745869385011200',
'0',
'1922149633',
"The nurse from the university said I couldn't go if I don't get another measles immunization...",
'-117.14384195',
'32.8110777']
我想将此数据写入csv文件,但是当我这样做时,python会将数字转换为科学记数法(例如1.404E12)。
我使用以下函数将列表列表转换为csv:
def list_to_csv(data,name_of_csv_string):
import csv
"""
This function takes the list of lists created from the twitter data and
writes it to a csv.
data - List of lists
name_of_csv_string - What do you think this could be?
"""
with open(name_of_csv_string + ".csv", "wb") as f:
writer=csv.writer(f)
writer.writerows(data)
我该如何避免这种情况?
答案 0 :(得分:0)
答案 1 :(得分:0)