我无法在熊猫csv中保存N / A

时间:2019-07-24 13:11:48

标签: python pandas csv

我在csv文件new.csv中有这个

company_name,industry,job_title,state,url
N/A,Accounting,Maintenance Person,Accounting,Arizona,https://www.jobs2careers.com/results3.php?q=Accounting&l=Littlefield%2C+AZ&s=150

当我尝试保存到item.csv时,它删除了N / A,所以我明白了

company_name,industry,job_title,state,url
,Accounting,Maintenance Person,Arizona,https://www.jobs2careers.com/results3.php?q=Accounting&l=Littlefield%2C+AZ&s=150

我尝试编码,但未成功

import pandas as pd


df = pd.read_csv('new.csv',encoding='utf-8')

df.to_csv('item.csv',index=False,encoding='utf-8')

0 个答案:

没有答案