sklearn ValueError: Expected 2D array, got 1D array instead

sklearn版本更新带来的问题
X =a.fit_transform(df[‘age’].astype(float))
改为
X =a.fit_transform(df[‘age’].astype(float).reshape(-1,1))