## list
df['channels'].explode().str.get_dummies().sum(level=0)
## string
pd.get_dummies(right_df.set_index('pair').te_right.str.split(',', expand=True), prefix='', prefix_sep='')\
.groupby(axis=1, level=0).sum()
Alternatives
MultiLabelBinarizer
MultiLabelCounter
from https://stackoverflow.com/a/57375810/14498100
-
Ref.
- https://stackoverflow.com/questions/57371409/multi-label-encoding-for-classes-with-duplicates
- https://stackoverflow.com/questions/36631163/what-are-the-pros-and-cons-between-get-dummies-pandas-and-onehotencoder-sciki