Reading Tabular Data and Inspecting Types
Unit ID: M09-U01 Estimated active time: 25-35 minutes
Read raw CSV values as text when you need to inspect and validate conversions deliberately.
raw = pd.read_csv("activity_log.csv", dtype="string", keep_default_na=False)
print(raw.shape)
print(raw.dtypes)
print(raw.head())
Inspect column names, row count, examples, blanks, and duplicate keys before changing data. Inferred numeric types are convenient, but they can hide mixed or malformed source values.
Keep raw unchanged. Create working = raw.copy() for transformations.
Practice: list three checks you would perform before converting minutes and score.
