Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove index in pandas data-frame while converting to html table

I am trying to remove index while converting pandas data-frame into html table. Prototype is as follows:

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

In html table I don't want to display index.

like image 516
arshpreet Avatar asked Dec 18 '22 03:12

arshpreet


1 Answers

Try this:

html_table = df.to_html(index = False)
like image 106
Wei Avatar answered Dec 20 '22 20:12

Wei