python讀寫csv

weixin_34357887發表於2018-08-16
import pandas as pd

NickName = ['a','b']
Sex = [1,0]
Province = ['J','Z']
data = {'NickName': NickName, 'Sex': Sex, 'Province': Province}
frame = pd.DataFrame(data)
frame.to_csv('data.csv',encoding='utf-8',index=False)

df = pd.read_csv('data.csv')

相關文章