我正在尝试使用 sci kit learn 的内置函数进行标签编码,但为什么我的结果打印为行而不是附加列?
from sklearn.preprocessing import LabelEncoder
# creating instance of labelencoder
labelencoder = LabelEncoder()
# Assigning numerical values and storing in another column
y_data['coded_sklearn'] = labelencoder.fit_transform(y_data['coded_sklearn'])
print(y_data)