python you have a DF with json strings jsonsstring {"categoryID":10,"params":{}}…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
python
you have a DF with json strings
jsons_string
{"categoryID":10,"params":{}} {"categoryID":10,"params":[{"id":5,"value":"MjA="}} {"categoryID":10,"params":[{"id":5,"value":"MjE="}} {"categoryID":10,"params":[{"id":5,"value":"MjI="}} {"categoryID":10,"params":[{"id":5,"value":"MjA="},{"id":157609,"value":"MzI1OTUxMw=="}} {"categoryID":10,"params":[{"id":5,"value":"MjA="},{"id":157609,"value":"MzI1OTUxNA=="}}
build ierarchy of jsons - level 1, 2 ,3, 4 , save result, child, parent to new DF
example
for {"categoryID":10,"params":[{"id":5,"value":"MjA="},{"id":157609,"value":"MzI1OTUxNA=="}]}
show parent {"categoryID":10,"params":[{"id":5,"value":"MjA="}
solve the task without from pandas.io.json import json_normalize
- Assistant
- User
error
for string 2 result is not empty
'{"categoryID":10,"params":[{"id":5,"value":"MjA="}]}'
his parent is '{"categoryID":10,"params":[] }'
- Assistant
- User
if we make
df.to_csv('rez15.csv') ImportError: cannot import name 'SequenceNotStr' from 'pandas._typing' (C:\Users\astereshko\AppData\Local\anaconda3\Lib\site-packages\pandas_typing.py)
- Assistant