I have a csv file and need to convert to html format. I know python pandas can do it with DataFormat.to_html(), but could not figure out what value to put in the (). I have:
pd.DataFrame.to_html(class=myfile.csv)
but got issue with it. Anyone has idea?
Mohamed Ali JAMAOUI
14.8k14 gold badges79 silver badges124 bronze badges
asked Jun 3, 2016 at 5:45
Peter Chao
4533 gold badges9 silver badges20 bronze badges
2 Answers 2
You need to put there dataframe:
df = pd.read_csv("myfile.csv")
df.to_html('your_file.html')
answered Jun 3, 2016 at 5:50
Anton Protopopov
31.9k13 gold badges93 silver badges96 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
You can put path where you want to save file including file name. Example: DF.to_html ("C:/desktop/test.html")
answered Jun 3, 2016 at 5:55
Felix
1,5798 gold badges20 silver badges36 bronze badges
Comments
default