What does df.dropna() do by default in pandas?
Correct answer
D. Drops rows containing any missing value
16 views
D. Drops rows containing any missing value
16 views
dropna defaults to axis=0, how="any", so any row with at least one NaN is removed, which can quietly shrink a dataset when one sparse column exists. Passing how="all" keeps rows that still have some data, and subset limits the check to chosen columns. Its counterpart fillna replaces nulls instead of removing them, which is usually safer when data is scarce.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is D? Ask here and get an explanation.