【发布时间】:2020-04-27 00:23:08
【问题描述】:
imp = SimpleImputer(missing_values=np.nan, strategy='most_frequent')
weather_test = imp.fit_transform(weather_test)
当 weather_test 是 pandas 数据框时,上面的代码在 google colab 中引发错误。 但是当我将 weather_test 更改为 numpy 数组时,它可以工作。
imp = SimpleImputer(missing_values=np.nan, strategy='most_frequent', verbose=0)
weather_test = imp.fit_transform(np.array(weather_test))
【问题讨论】:
-
您介意添加完整的错误吗?
标签: pandas scikit-learn google-colaboratory