Google News
logo
Pandas - Interview Questions
How can we handle NaN values in Pandas DataFrame?
NaN values in a Pandas DataFrame can be handled in the following three ways :
 
dropna : Removing all the rows in DataFrame for which values in column are NaN

pad : Replacing NaN values with previous non NaN values meaning replacing NaN with value just above it in same column

backfill : Replacing NaN values with ahead non NaN values meaning replacing NaN with value just below it in same column
Advertisement