import pandas as pd excel_file = pd.ExcelFile('my_file.xlsx') df = pd.read_excel(excel_file, sheet_name='Sheet1')
import pandas as pd excel_file = pd.ExcelFile('my_file.xlsx') df = pd.read_excel(excel_file, sheet_name='Sheet1', usecols='C:E', nrows=10)This code reads the data from columns C to E and rows 1 to 10 of the first sheet of the 'my_file.xlsx' Excel file into a pandas DataFrame. Package Library: The package library used in these examples is pandas.io.excel.