A record is a small mapping for one observation. A DataFrame arranges many observations into named columns with explicit types and row labels. Moving between them changes how operations align, how missing values appear and how aggregation works.
This course follows the existing cleaning pipeline. It uses actual Pandas2.3.3, not a simulated table API. You finish by reimplementing that records-based audit and checking complete report parity. First build a small typed frame deliberately instead of accepting inference as an undocumented policy.
Business IDs stay in columns as strings. The RangeIndex is a row-label convention, not an automatically unique business identifier. Leading zeroes remain meaningful. Pandas string and nullable Int64 make text and missing integer behavior visible.
The bounded lesson schema permits None in cents and uses signed64-bit limits. Boolean values are excluded even though Python bool is an int subclass. Build fresh arrays so editing the resulting frame does not mutate the original dictionaries.
import pandas as pd
frame=pd.DataFrame({"id":pd.array(["001","002"],dtype="string"),"cents":pd.array([0,None],dtype="Int64")})
print(frame["id"].tolist())
print(str(frame["cents"].dtype),frame["cents"].isna().sum())Inference can be convenient for exploration, but it is not a substitute for a reviewed input contract. A nullable integer schema prevents an absent amount from forcing all cents through floating point. An explicit empty frame also avoids a different schema when a fixture has no rows.
The download uses a normal isolated virtual environment. Hosted examples use pinned read-only Pandas/NumPy in the existing offline sandbox. They do not install packages or gain host filesystem/network access while running.
import pandas as pd
frame=pd.DataFrame({"id":["a","b"]},index=[10,20])
frame["wrong"]=pd.Series([1,2])
frame["position"]=pd.array([1,2],dtype="Int64")
print(frame["wrong"].isna().tolist())
print(frame["position"].tolist())Implement the typed frame constructor and inspect actual dtypes/index values. Next load raw CSV while retaining the evidence needed by the existing cleaning policy.