Initial EDA and data-quality checks
Inspect types, missing values, duplicate candidates, and unusual patterns before writing cleaning rules.
On this page
Profile the raw file
Read the original values as strings when you want to see how source codes are represented. Inspect shape and column names first, then count blanks and unexpected labels in the columns you need.
import pandas as pd
raw = pd.read_csv("store_sales.csv", dtype="string", keep_default_na=False)
print(raw.shape)
print(raw.duplicated().sum())
print(raw["Location"].str.strip().eq("").sum())
Example output
(15, 8) 1 1
Check patterns, not just null counts
Confirm ID uniqueness against the row grain. Validate date range, allowed categories, and numeric rules. Inspect candidate outliers before deciding they are errors or legitimate observations.