Reference · Cheatsheet

ML Python starter card

Minimum Python before AI/ML labs in Lane D.

Minimum Python before AI/ML labs in Lane D.

Core syntax

  • Variables, lists, `for` loops
  • Functions with `return`
  • `if` / `else` decisions
  • Read files with `open()` or pandas

Tables & plots

import pandas as pd
df = pd.read_csv("data.csv")
df.describe()
  • Filter rows: `df[df["score"] > 0.5]`
  • Plot scatter with matplotlib when exploring clusters
  • First ML loop

  • Labels + scores → threshold → accuracy
  • Always ask: “Would this work on **new** rows?”
  • **Related:** glossary `pandas`, `matplotlib`, `classification`, `threshold`