1y = pd.get_dummies(df.Countries, prefix='Country')
2print(y.head())
3# from here you can merge it onto your main DF
1from sklearn.preprocessing import MultiLabelBinarizer
2
3mlb = MultiLabelBinarizer()
4df = df.join(pd.DataFrame(mlb.fit_transform(df.pop('Col3')),
5 columns=mlb.classes_,
6 index=df.index))