4

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?

2 Answers 2

9

You need to put there dataframe:

df = pd.read_csv("myfile.csv")
df.to_html('your_file.html')
Sign up to request clarification or add additional context in comments.

Comments

0

You can put path where you want to save file including file name. Example: DF.to_html ("C:/desktop/test.html")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.