运行 ❯
获取您的
专属 Python
服务器
×
更改方向
更改主题,深色/浅色
前往 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