MultiLabelBinarizer output classes in letters instead of categories
问题 I have a dataframe where one column is short_names . short_names consist of 2-5 letters of names => BG , OP , LE , WEL , LC . Each row can have any number of names. I am trying to use MultiLabelBinarizer to convert the names into individual columns such that if the rows have similar names then there will be 1 in the columns one_hot = MultiLabelBinarizer() one_hot.fit_transform(df['short_name']) one_hot.classes__ Because there is a '-' in one the rows which result in an error TypeError: 'float