Read last sheet from excel file in python

excel
python

#1

Hi,

How to read the last sheet from excel.

Thanks,
Sachin


#2

@sachin123456 You can read excel files using pandas and even specify the sheet you want to read.

import pandas as pd
df = pd.read_excel('filename.xlsx', sheetname = "sheetname") 

#3

You can also provide sheet number(starting from 0, for ex: for 1st sheet use 0 for 2nd sheet use 1) in “sheet_name” argument. In below :pandas. read_excel ( io , sheet_name=0 , header=0 , names=None , index_col=None , usecols=None , squeeze=False , dtype=None , engine=None , converters=None , true_values=None , false_values=None , skiprows=None , nrows=None , na_values=None , parse_dates=False , date_parser=None , thousands=None , comment=None , skipfooter=0 , convert_float=True , **kwds )[source]