Block 42: Excel with pandas & openpyxl
Read and write Excel files with multiple sheets.
Concepts
- pd.read_excel() with sheet_name parameter
- pd.to_excel() with ExcelWriter
- Multiple sheets in one file
- Cell formatting basics with openpyxl
Code Examples
See exercise below.
Exercise
Load an Excel file with 2 sheets; combine them into one DataFrame. Export a cleaned DataFrame to Excel with a custom sheet name.
Homework
What are the practical differences between CSV and Excel for data storage? Tuesday