Part 06 / Topic 1 of 7
Profiling a dataset
Before cleaning anything, measure it. A profile is twenty minutes that saves two weeks:
df = pd.read_csv(export, dtype=str) # dtype=str: profile the raw text before coercing
print(len(df), "rows")
print(df.isna().sum()) # nulls per column
print(df["status"].value_counts()) # every distinct spelling, with counts
print(df["shipment_id"].duplicated().sum(), "duplicated ids")
Read dtype=str as a profiling stance: you want to see "-5 kg" and "03/02/2025" as the customer wrote them, not as pandas guessed them. The profile tells you exactly which cleaning rules to write — and it becomes the "before" picture in your report to the customer.
Done here? The practice set for Part 6 — 4 exercises with solutions — is on the part page.