for y in range(len(l1.columns)):
for w in e1:
from sklearn import preprocessing
LE=preprocessing.LabelEncoder()
LE.fit(w)
X3[:,y]=LE.transform(X3[:,y])
where l1 is a dataframe consisting of only string datatype in it's columns and e1 is a list containing the labels as:[['F', 'M'], ['NORMAL', 'LOW', 'HIGH'], ['NORMAL', 'HIGH']] and X3 is an array in which I want the encoded values. In doing so....
I am getting the following error:
ValueError: y contains previously unseen labels.
Any help appreciated. Thank you.
question from:
https://stackoverflow.com/questions/65599129/i-have-a-problem-encoding-the-labels-and-storing-them-back-into-the-array 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…