Answers for "how to use pandas with excel in python"

9

export pandas dataframe as excel

df.to_excel(r'C:UsersRonDesktopFile_Name.xlsx', index = False)

#if you omit the file path (must also omit 'r') and 
#enter only file_name.xlsx, it will save to your default file location,
# that is, where the file you're reading from is located.
Posted by: Guest on June-25-2021
-1

python pandas read_excel

#You will need the package openpyxl to use the .read_excel function.
# pip install openpyxl
import pandas as pd
inFile = "Table.xlsx"
inSheetName = "Sheet1"
pd.read_excel(inFile, sheet_name = inSheetName)
Posted by: Guest on August-20-2021

Code answers related to "how to use pandas with excel in python"

Python Answers by Framework

Browse Popular Code Answers by Language