xxxxxxxxxx
import os
from pathlib import Path
# opening EXCEL through Code
#local path in dir
absolutePath = Path('../excel.xlsx').resolve()
os.system(f'start excel.exe "{absolutePath}"')
xxxxxxxxxx
df = pd.read_excel('Path.xlsx', sheet_name='Desired Sheet Name', na_values='n/a')
xxxxxxxxxx
import pandas as pd
df = pd.read_excel (r'Path where the Excel file is stored\File name.xlsx')
print (df)
xxxxxxxxxx
import pandas as pd
# Specify the file path of the Excel file
excel_file = "path/to/your/file.xlsx"
# Read the Excel file and store it in a DataFrame
df = pd.read_excel(excel_file)
# Print the contents of the DataFrame
print(df)
xxxxxxxxxx
#My excel file is in the same location as my
EXCEL_FILE = 'Demo_excelsheet.xlsx'
df = pd.read_excel(EXCEL_FILE)