[英]Create nested dictionaries from similar value in a column and use value as key for dictionaries contain all rows with that value
[英]How to clean all rows of a column which contains nested dictionaries and each value of key-value pair becomes new column
試試這個片段:
import json
li=[]
for ind in df1.index:
temp=json.load(df1["level_options"][ind])
temp.update(json.load(df1["extra_info"][ind]))
li.append(pd.json_normalize(temp))
li
在這里,在循環迭代之后,列表li
將具有所需的數據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.