Pandas嵌套词典解析或取值

Posted on 2022-01-09 19:04  o0o0o9  阅读(95)  评论(0编辑  收藏  举报

 

 

# tribe列只保留name 值
df['tribe']=df['tribe'].apply(lambda x:eval(x)['name'])

# tribe 列全部项目展开
df=df['content'].apply(pd.Series) 

 

Copyright © 2024 o0o0o9
Powered by .NET 9.0 on Kubernetes