1import pandas as pd
2
3df = pd.read_excel (r'Path where the Excel file is stored\File name.xlsx', sheet_name='your Excel sheet name')
4print (df)
5
1#Creating the ExcelFile object
2xls = pd.ExcelFile(r'Path.xlsx')
3#In the next step, you can pass the ExcelFile object to read_excel to import
4#its content, instead of the path to the file.
5data = pd.read_excel(xls, sheet_name='Name_of_sheet', index_col='Index_Column')
1from win32com.client import Dispatch
2
3xl = Dispatch("Excel.Application")
4xl.Visible = True # otherwise excel is hidden
5
6# newest excel does not accept forward slash in path
7wb = xl.Workbooks.Open(r'C:\Users\300231823\Desktop\GUI\simplenew4.xls')
8wb.Close()
9xl.Quit()
10