转换为html表时,删除pandas数据框中的索引

ars*_*eet 4 python indexing dataframe pandas

我想在将pandas data-frame转换为html表时删除索引.原型如下:

import pandas as pd
import numpy as np
df= pd.DataFrame({'list':np.random.rand(100)})
html_table = df.to_html()
Run Code Online (Sandbox Code Playgroud)

在html表中我不想显示索引.

Wei*_*Wei 5

试试这个:

html_table = df.to_html(index = False)
Run Code Online (Sandbox Code Playgroud)