Impute, and keep the fact that it was missing
In application data, a blank field usually means something. Throwing that signal away to fill the value is a real loss.
from sklearn.impute import SimpleImputer
import numpy as np
X = np.array([[45_000, 3.0],
[np.nan, 1.0],
[62_000, np.nan],
[51_000, 2.0]])
# add_indicator appends a boolean column per feature that had NaNs
imp = SimpleImputer(strategy="median", add_indicator=True)
out = imp.fit_transform(X)
print(out)
# [[4.5e4 3.0 0.0 0.0]
# [5.1e4 1.0 1.0 0.0] <- income was missing
# [6.2e4 2.5 0.0 1.0] <- dependants was missing
# [5.1e4 2.0 0.0 0.0]]
# The model can now learn "applications with no stated income behave
# differently", which is often more predictive than the imputed value.