i have one workbook with 53 worksheets in excel. I want to get all the data from the sheets, but i need only the data in particular rows and columns. The data structure in workbook is the same in all sheets.
The structure is something like this:
i have one workbook with 53 worksheets in excel. I want to get all the data from the sheets, but i need only the data in particular rows and columns. The data structure in workbook is the same in all sheets.
The structure is something like this:
You can use pandas
:
import pandas as pd
# Read multiple sheets from one workbook
with pd.ExcelFile('path_to_file.xlsx') as xlsx:
df1 = pd.read_excel(xlsx, 'Sheet1')
df2 = pd.read_excel(xlsx, 'Sheet2')
# Work with specific columns
df1[['Column1', 'Column2']] # Do something with these
df1[['Column1', 'Column2']] # Do something with these