Python converting excel to other formats like csv ,json and html formats using pandas library
I am attaching csv conversion code here
#Pandas to be the most useful for data science operations
#Convert a Python's list, dictionary or Numpy array to a Pandas data frame.
#Open a local file using Pandas, usually a CSV file, but could also be a delimited text file (like TSV), Excel, etc.
#Handling of data. The Pandas library provides a really fast and efficient way to manage and explore data. ...
#Alignment and indexing. ...
#Handling missing data. ...
#Cleaning up data. ...
#Input and output tools. ...
#Multiple file formats supported. ...
#Merging and joining of datasets. ...
#A lot of time series.
import pandas as pd
#Excel is a Input File Path . csv,Json,html and Sql files are out put .
excel_file_path='/content/sample_data/Test.xlsx'
output
csv_file_path ='/content/sample_data/Test.csv'
json_file_path='/content/sample_data/Test.json'
html_file_path ='/content/sample_data/Test.html'
Excel sheet name Ex: Sheet1 as 1 and Sheet2 as 2
primaryexcelsheet='Sheet1'
#Reading Excel File from particular excel sheet
read_Excelfile =pd.read_excel(excel_file_path,sheet_name=primaryexcelsheet)
convert excel files into CSV, Json, Html and sql Formats
def format_csv(excel_file_path,csv_file_path):
read_Excelfile =pd.read_excel(excel_file_path,sheet_name=primaryexcelsheet)
read_Excelfile.to_csv(csv_file_path,index=None,header=True)
format_csv(excel_file_path,csv_file_path)
Watch video Python -How to convert excel to other formats (CSV,JSON and HTML) online, duration hours minute second in high quality that is uploaded to the channel Technical RPA 14 July 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 12,648 times and liked it 51 visitors.