Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import pandas as pd data = { "Brand": ["Ford", "Ford", "Ford"], "Model": ["Sierra", "F-150", "Mustang"], "Typ" : ["2.0 GL", "Raptor", ["Mach-E", "Mach-1"]] } df = pd.DataFrame(data) newdf = df.explode('Typ') print(newdf)
Brand Model Typ 0 Ford Sierra 2.0 GL 1 Ford F-150 Raptor 2 Ford Mustang Mach-E 2 Ford Mustang Mach-1