I wrote a web scraper to pull information from a table of products and build a dataframe. The data table has a Description column which contains a comma separated string of attr
Use pd.get_dummies
cols = ['PRODUCTS', 'DATE'] pd.get_dummies( df.set_index(cols).DESCRIPTION \ .str.split(',\s*', expand=True).stack() ).groupby(level=cols).sum().astype(int)