Index Ai Academy
Phase 0 · Tools · Working with data

Files and CSV data

Read and write files, and turn a spreadsheet export into Python data.

About 25 minutes · Free lesson

Start this lesson

Why it matters

Real data lives in files: CSV exports from ad platforms and CRMs, documents you want a model to summarize, files of example prompts and replies for testing or fine-tuning, logs of everything your app sent to a model. Before you can analyze, embed or train on any of it, you need to get it into Python, and write your results back out.

What you'll be able to do

  • Write text to a file and read it back with open() and with
  • Process a file one line at a time
  • Read a CSV export into rows you can calculate with, and write one
  • Build file paths with pathlib

Before this lesson

Next in this phase: NumPy arrays