如下所示:
1
2
3
4
5
6
7
8
|
#!/usr/bin/env Python
# coding=utf-8
import html">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格式的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/wangxingfan316/article/details/79609711