2 回答

TA贡献2036条经验 获得超8个赞
>>> df['myextraction'] = df['weirdo'][0]['Item'][0]['Value']
>>> df
normalvar weirdo myextraction
0 1 {'Item': [{'basket': 'Text', 'Value': 'Stackov... Stackoverflow

TA贡献1772条经验 获得超6个赞
尝试:
df['myextraction'] = pd.DataFrame.from_records(np.array(df.weirdo.values.tolist()).ravel(),
index=df.index)['Value']
输出:
normalvar weirdo myextraction
Item 1 [{'basket': 'one', 'Value': 'Stackoverflow'}] Stackoverflow
Item2 1 [{'basket': 'two', 'Value': 'SO'}] SO
添加回答
举报