АМ
Size: a a a
АМ
ВЛ
АМ
ВЛ
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values='NaN', strategy='mean', axis=0, verbose=0, copy=True)
imputer.fit(df_train)
df_train = imputer.transform(df)
df_train = pd.DataFrame(df, columns=columns)
columns
АМ
АМ
columns = ['a','b']АМ
pd.DataFrame(df, columns=columns) можно оставить только колонки 'a' и 'b'АМ
АМ
df[['a','b']]ВЛ
df[['a','b']]ВЛ
[[1,2],[3,4]], columns=[a,b]
АМ
АМ
ВЛ
b
DS
АМ
A
АМ
ОН