I have a DataFrame with the fields as shown. Dataframe fields
I am trying to fill the null values with the median of the column Loan_Amount_Term with the below code: (The column has 14 null values)
hd['Loan_Amount_Term'] = hd['Loan_Amount_Term'].replace(np.isnan(hd['Loan_Amount_Term']),hd['Loan_Amount_Term'].median())
But I am getting the following error: Series.replace cannot use dict-like to_replace and non-None value
I want to know why I cannot impute the null values with median in this way.
Thanks in advance.