InterviewSolution
Saved Bookmarks
| 1. |
How will you identify and deal with missing values in a dataframe? |
|
Answer» We can identify if a DATAFRAME has missing values by using the isnull() and isna() methods. missing_data_count=DF.isnull().sum()We can handle missing values by EITHER replacing the values in the column with 0 as follows: df[‘column_name’].fillna(0)df[‘column_name’] = df[‘column_name’].fillna((df[‘column_name’].mean())) |
|