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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

诺坎普奇迹   2021-03-30 我要评论

如下所示:

#!/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格式的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们