text_html_output_1.png
from sklearn.preprocessing import MultiLabelBinarizer

import pandas as pd

train_df = pd.read_csv('../input/imet-2020-fgvc7/train.csv')
train_df['attribute_ids'] = train_df['attribute_ids'].apply(lambda x: x.split(' '))
train_df['id'] = train_df['id'].apply(lambda x: x + '.png')

from sklearn.preprocessing import MultiLabelBinarizer
mlb = MultiLabelBinarizer()
train_df_d = pd.DataFrame(mlb.fit_transform(train_df['attribute_ids']), columns=mlb.classes_, index=train_df.index)

train_df_d[:1][['448', '2429', '782']]