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)
Смотрите видео Python -How to convert excel to other formats (CSV,JSON and HTML) онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Technical RPA 14 Июль 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 12,648 раз и оно понравилось 51 посетителям.