成功解决TypeError: Encoders require their input to be uniformly strings or numbers. Got [‘float‘, ‘int‘,‘str’]
今天在给数据编码的时候,在将离散特征转换为整数编码时,出现了报错如下:

后来发现可以先将要编码的离散变量全部转换成字符型的,例如作出如下修改:
from sklearn.preprocessing import LabelEncoder
clean_loan_of[attri_cols] = clean_loan_of[attri_cols].astype(