Answers for "how to convert excel file to csv in python"

11

Convert Excel to CSV using Python

import pandas as pd
data_xls = pd.read_excel('excelfile.xlsx', 'Sheet2', dtype=str, index_col=None)
data_xls.to_csv('csvfile.csv', encoding='utf-8', index=False)
Posted by: Guest on December-13-2020
0

convert excel file to csv with pandas

import pandas as pd
import os

df = pd.read_excel('Book1.xlsx', sheet_name='Sheet1')
current_working_directory = os.getcwd()
save_path = current_working_directory + '\file_name.csv'
df.to_csv(save_path)
Posted by: Guest on December-04-2021

Code answers related to "how to convert excel file to csv in python"

Python Answers by Framework

Browse Popular Code Answers by Language