The Problem
Real data moment
A real Inside Airbnb snapshot for Asheville, NC — 2,865 real listings, 90 real columns — has missing data showing up in genuinely different ways:
import pandas as pd
df = pd.read_csv("listings.csv.gz", compression="gzip", low_memory=False)
print(df["review_scores_rating"].isna().sum())
print(df["price"].isna().sum())
218
249
218 real listings have no review score. 249 have no listed price. These look like the same kind of problem. They aren't.
The gotcha
Try the version without subset — the one that looks like "just clean the data":
fully_clean = df.dropna()
print(fully_clean.shape)
(0, 90)
Zero rows. Not fewer — none. With 90 real columns, essentially every one of the 2,865 listings is missing something somewhere (an empty neighborhood_overview, a blank license, an unset host_about) — and plain dropna() demands every column be non-null to survive. The entire real dataset silently disappeared, with no error, because "clean the missing data" and "delete almost the whole dataset" turned out to be the same instruction.
inplace=True doesn't just look old-fashioned — it can silently do nothing at all
The legacy advice to prefer inplace=True "to save memory" was never fully accurate, and under Copy-on-Write it's actively wrong for this common pattern: selecting a column out of a DataFrame first, then calling an inplace method on that selection.
print(df["price"].isna().sum())
df["price"].fillna(0, inplace=True)
print(df["price"].isna().sum())
249
249
Same count, before and after — inplace=True on a column selected out of a DataFrame is itself a form of chained assignment, and under Copy-on-Write it modifies a temporary copy that's immediately discarded. pandas even emits a ChainedAssignmentError warning naming the fix directly: reassign instead.
df["price"] = df["price"].fillna(0)
print(df["price"].isna().sum())
0
A real estate dataset has a "pool" column that's True for listings with a pool, and NaN for listings where it was never recorded either way (not "no pool" — genuinely unknown). What's the most defensible way to handle it before analysis?
"Unknown" and "false" are genuinely different claims — filling unknown with False silently manufactures data that was never actually collected, in either direction. Leaving it as NaN and being explicit that pool-related findings only cover listings where the field is actually known is the honest choice; dropping those rows entirely would also be defensible if the analysis specifically needs a clean pool column, but silently guessing a value is not.