from sklearn.preprocessing import LabelEncoder
cell_name_label=pd_data['cell_type']
conpound_name_label=pd_data['sm_lincs_id']
cell_cat=LabelEncoder().fit_transform(cell_name_label)
cell_label=F.one_hot(torch.from_numpy(cell_cat).long())#,max(cell_cat)
conpound_cat=LabelEncoder().fit_transform(conpound_name_label)
conpound_label=F.one_hot(torch.from_numpy(conpound_cat).long())
标签:字符,conpound,转换,name,LabelEncoder,label,cell,hotlabel,cat
From: https://www.cnblogs.com/yonggie/p/17861931.html