How to create multi-hot encoding from a list column in dataframe?
You can try using sklearn's MultiLabelBinarizer (https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MultiLabelBinarizer.html):
mlb = MultiLabelBinarizer()
mlb.fit(d['IDs'])

new_col_names = [&quot;ID_%s&quot; % c for c in mlb.classes_]

# Create new DataFrame with transformed/one-hot encoded IDs
ids = pd.DataFrame(mlb.fit_transform(d['IDs']), columns=new_col_names)

# Concat with original `Label` column
pd.concat( [d[['Label']], ids], axis=1 )