Complete the code to check for missing values in the DataFrame.
missing = df.isnull().[1]()count() which counts non-missing values instead.fillna() which replaces missing values instead of counting.The sum() function counts the number of missing values in each column.
Complete the code to fill missing values with the mean of the column.
df['age'] = df['age'].[1](df['age'].mean())
dropna() which removes rows instead of filling values.replace() which replaces specific values but not missing ones by default.The fillna() method replaces missing values with the given value, here the mean.
Fix the error in the code to drop rows with any missing values.
cleaned_df = df.[1](axis=0, how='any')
fillna() which fills missing values instead of dropping rows.isnull() which only detects missing values.The dropna() method removes rows or columns with missing values. Here, axis=0 means rows.
Fill both blanks to create a new DataFrame with missing values replaced by the median.
df_clean = df.[1](df.[2]())
mean instead of median for the second blank.dropna which removes rows instead of filling values.First, calculate the median with median(), then fill missing values using fillna().
Fill all three blanks to create a dictionary of column means for filling missing values.
fill_values = {col: df[col].[1]() for col in df.columns if df[col].[2]().any()}
df_filled = df.[3](fill_values)dropna instead of fillna for the third blank.notnull instead of isnull for the second blank.Calculate the mean of each column with missing values using mean(), detect missing values with isnull(), and fill them using fillna().
