-1

I am having excel and want to read the second worksheet. But everytime getting only first worksheet. Is there a way to get second worksheet without giving its name?

import pandas as pd
dfs = pd.read_excel("data.xlsx")
print dfs
Rishi Bansal
  • 3,271
  • 2
  • 22
  • 42
  • 1
    Possible duplicate of [Using Pandas to pd.read\_excel() for multiple worksheets of the same workbook](https://stackoverflow.com/questions/26521266/using-pandas-to-pd-read-excel-for-multiple-worksheets-of-the-same-workbook) – Georgy Dec 10 '18 at 10:54

1 Answers1

2

Use sheet_name argument under pd.read_excel to read a specific sheet.

Example:

sheet_name=1 reads second sheet.

meW
  • 3,652
  • 6
  • 24