我有一个看起来像这样的熊猫数据框:
df = pd.DataFrame({'x':['''[{"key":"Gender","value":["Men"]},
{"key":"Shoe Size","value":["M"]},
{"key":"Shoe Category","value":["Men's Shoes"]},
{"key":"Color","value":["Multicolor"]},
{"key":"Manufacturer Part Number","value":["8190-W-NAVY-7.5"]},
{"key":"Brand","value":["Josmo"]}]''',
'''[{"key":"Gender","value":["Women"]},
{"key":"Size","value":["XL"]},
{"key":"Heel Height","value":["1 Inches"]}]'''],
'y':['A','B']})
它基本上是一个键值对列表,我希望将它们提取到它们自己的列中,并且行之间的键不一致。
关于如何去做的任何想法?
缥缈止盈
森栏
相关分类