Skip to content

Pandas

Beginner → Intermediate · 6 topics

pandas works with tables — rows and named columns, like a spreadsheet you control with code. In GenAI work you'll use it to load documents, clean data, prepare RAG chunks, compare models and turn LLM logs into reports. It's built on NumPy.

pip install pandas          # or: uv add pandas

All the pages use one small, realistic dataset — LLM evaluation results:

model question latency_ms tokens cost_usd rating
gpt-4o-mini What is RAG? 820 210 0.00013 5
llama-3.1-8b What is RAG? 410 190 0.00002 4
… … … … … …
# Topic Sub-topics
1 Series & DataFrames Create tables · read CSV/JSON · inspect: head, info, describe · save
2 Selecting & filtering Columns · loc / iloc · conditions · isin, str.contains · query · sorting
3 Cleaning data Missing values · types · dates · duplicates · text cleanup · new columns
4 Grouping & aggregation groupby · named aggregations · transform · value_counts · pivot tables
5 Combining & reshaping merge (joins) · concat · melt · pivot · explode
6 Pandas for GenAI RAG chunks · token & cost reports · model comparison · JSONL for fine-tuning

Pandas thinks in columns

Write df["cost"] * 1000, not a loop over rows. Column operations are short, readable and run at NumPy speed.

Next: Series & DataFrames →