Welcome folks today in this blog post we will be
converting csv file to html table using pandas library full tutorial for beginners. All the source code of the tutorial will be given below.
In order to get started we need to install the following library
pip install pandas
Just install this
pandas library and now create a
app.py file and copy paste the following code
import pandas as pd
# to read csv file named "samplee"
a = pd.read_csv("users.csv")
# to save as html file
# named as "Table"
# assign it to a
# variable (string)
html_file = a.to_html()
Now create a
users.csv file inside your root directory of your project like this
And if you run this script by executing the below command
and now a
table.html file will be created in the root folder of your project like below.