📅  最后修改于: 2022-03-11 14:46:34.491000             🧑  作者: Mango
from sklearn.compose import ColumnTransformer
ct = ColumnTransformer([('encoder', OneHotEncoder(), [1])], remainder='passthrough')
X = np.array(ct.fit_transform(X), dtype=np.float)