python--pandas convert excel to online html

#encoding:utf-8
import pandas as pd
import codecs
def test19():
    xd = pd.ExcelFile('b站.xls')
    df = xd.parse()
    with codecs.open('1.html', 'w', 'UTF-8') as html_file:
        html_file.write(df.to_html(header=True, index=False))

 

Guess you like

Origin www.cnblogs.com/zhouzetian/p/12712856.html