I have below dataframe
df[['row_num','set_id']].head()
row_num path_id_set
988681 [31672, 0]
988680 [31965, 0]
988679 [0, 78464]
我正在尝试使用多标签二值化器,但出现了错误代码“float object not iterable”。
from sklearn.preprocessing import MultiLabelBinarizer
mlb = MultiLabelBinarizer()
mlb.fit_transform(df['set_id'].str.split(','))
TypeError: 'float' object is not iterable