Block 29: Exporting & I/O Operations
Save processed DataFrames to various file formats.
Concepts
- to_csv(), to_excel(), to_json()
- index=False to avoid extra index column
- Reading back saved files
- Chunking for large files
Code Examples
See exercise below.
Exercise
Load a CSV, clean it (drop nulls, fix types), and export cleaned version with a new filename. Export a summary groupby result to Excel with a named sheet.
Homework
What's the risk of saving index=True when re-loading a CSV later? Test it.