我无法在几天内使用OneHotEncoder

时间:2019-05-19 10:24:44

标签: scikit-learn one-hot-encoding

我想几天使用OneHotEncoder。列名是day,包括星期日,星期六,星期四,星期五

ValueError:无法将字符串转换为浮点数:“ Thur”

import pandas as pd

veriler = pd.read_csv("tips.csv")

days=veriler.iloc[:,4:5].values

from sklearn.preprocessing import OneHotEncoder
ohe=OneHotEncoder(categorical_features="all")
days=ohe.fit_transform(days).toarray()
ValueError: could not convert string to float: 'Thur'

0 个答案:

没有答案