美文网首页Python基础
Python-01-读取/输出

Python-01-读取/输出

作者: 郝十万 | 来源:发表于2018-08-23 11:43 被阅读11次

"""

第一次尝试:读取excel,导出csv

"""

import pandasas pd

import xlrd

d = pd.read_excel('F:\demo.xlsx',sheet_name=0)

print(d.head())

d.to_csv('F:\demo.xlsx',encoding='utf_8_sig',index=False)#encoding='utf_8_sig'解决中文乱码

相关文章

网友评论

    本文标题:Python-01-读取/输出

    本文链接:https://www.haomeiwen.com/subject/kippiftx.html