.sheet_names attribute
While our previous sales files contained all information in the initial reading of the file, we'll have to dig a little deeper when dealing with a whole workbook.
The theater_report.xlsx workbook contains a few helpful tabs for you to create your report. Can you get the names of these tabs?
Once again, pandas has already been loaded for you as pd
Este exercício faz parte do curso
Python for Spreadsheet Users
Instruções do exercício
- Use the
.sheet_namesattribute to get the sheet names oftheater_reportand assign the result totheater_sheets. - Print the sheet names.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Read in the whole workbook
theater_report = pd.ExcelFile('theater_report.xlsx')
# Get sheet names
# Print sheet names