python pandas实现excel转为html格式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangxingfan316/article/details/79609711
#!/usr/bin/env Python
# coding=utf-8
import pandas as pd
import codecs
xd = pd.ExcelFile('/Users/wangxingfan/Desktop/1.xlsx')
df = xd.parse()
with codecs.open('/Users/wangxingfan/Desktop/1.html','w','utf-8') as html_file:
    html_file.write(df.to_html(header = True,index = False))

猜你喜欢

转载自blog.csdn.net/wangxingfan316/article/details/79609711
今日推荐