{% if columns %}
import numpy as np
from sklearn.impute import SimpleImputer

NUMERIC_COLS_WITH_MISSING_VALUES = {{ columns }}
simple_imputer = SimpleImputer(missing_values=np.nan, strategy='mean')
{{ train_dataset }}[NUMERIC_COLS_WITH_MISSING_VALUES] = simple_imputer.fit_transform({{ train_dataset }}[NUMERIC_COLS_WITH_MISSING_VALUES])
{{ test_dataset }}[NUMERIC_COLS_WITH_MISSING_VALUES] = simple_imputer.transform({{ test_dataset }}[NUMERIC_COLS_WITH_MISSING_VALUES])
{% endif %}
{% if cols_almost_missing_numeric %}
NUMERIC_ALMOST_MISSING_COLS = {{ cols_almost_missing_numeric }}
{{ train_dataset }}[NUMERIC_ALMOST_MISSING_COLS] = {{ train_dataset }}[NUMERIC_ALMOST_MISSING_COLS].fillna(0)
{{ test_dataset }}[NUMERIC_ALMOST_MISSING_COLS] = {{ test_dataset }}[NUMERIC_ALMOST_MISSING_COLS].fillna(0)
{% endif %}