这是代码:
housing_cat1 = X_train[:,[2,7,8,10,11,13,14,15,16,21,22,23,24,25,27,28,29,30,31,32,33,35,39,40,41,42,53,55,57,58,60,63,64,65,73,74,78,79]].reshape(1,-1)
from future_encoders import OneHotEncoder
cat_encoder = OneHotEncoder(sparse=False) # Set to True if sparse matrix is needed
housing_cat_1_1hot = cat_encoder.fit_transform(housing_cat)
housing_cat_1_1hot