python数据分析之读取文件

2018-05-14  本文已影响0人  冬笋土豆西红柿

读取csv文件

编码为utf-8,不设置第一列索引

import pandas as pd
zhuanti =  pd.read_csv(open('C:/MongoDB/Server/3.4/bin/xiaozhu.csv',encoding='utf-8'))
print(zhuanti)

编码为utf-8,设置第一列索引

import pandas as pd
zhuanti =  pd.read_csv(open('C:/MongoDB/Server/3.4/bin/xiaozhu.csv',encoding='utf-8'),index_col=0)
print(zhuanti)
上一篇下一篇

猜你喜欢

热点阅读