我有一个文本文件,每行都有json对象,如下所示。我可以知道使用pandas释放json的一些方法吗
{"resource":{"resourceType":"bund","id":"c4356","extension":[{"url":"member","valueString":"covid"},{"url":"complaint","valueString":"ache"},{"url":"code","valueCodeableConcept":{"id":"797fe48b","coding":[{"system":"followup","code":"choice","display":"Please followup"}]}}],"identifier":[{"use":"primary","system":"consult","value":"3867"},{"use":"secondary","system":"visit","value":"9089"},{"use":"third","system":"kjhd","value":"972e68"}],"codes":[56,86,65]}}
{"resource":{"resourceType":"bund","id":"dvdv6","extension":[{"url":"member","valueString":"covid"},{"url":"complaint","valueString":"stomach"},{"url":"code","valueCodeableConcept":{"id":"9765e48b","coding":[{"system":"followup","code":"choice","display":"Please followup"}]}}],"identifier":[{"use":"primary","system":"consult","value":"3867"},{"use":"secondary","system":"visit","value":"8789"},{"use":"third","system":"kjhd","value":"872e68"}],"codes":[76,89,90]}}
我尝试使用json_normalize编写代码
使用
json_normalize()
explode()
的嵌入列表(reset_index()
以便联接可以工作)apply(pd.Series)
连接回嵌入式DICT的数据帧相关问题 更多 >
编程相关推荐