您的位置:首页 > 编程语言 > Python开发

python pandas实现excel转为html格式的方法

2018-10-23 20:05 1021 查看

如下所示:

#!/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))

以上这篇python pandas实现excel转为html格式的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python pandas excel html