I have a dataframe where some cells contain lists of multiple values. Rather than storing multiple values in a cell, I\'d like to expand the dataframe so that each item in t
import pandas as pd df = pd.DataFrame([{'Product': 'Coke', 'Prices': [100,123,101,105,99,94,98]},{'Product': 'Pepsi', 'Prices': [101,104,104,101,99,99,99]}]) print(df) df = df.assign(Prices=df.Prices.str.split(',')).explode('Prices') print(df)
Try this in pandas >=0.25 version