我有一个熊猫df
,它在某些列中保存值列表,例如:
ID Unique_ID MeSH_heading tree_num term_concepts term_strings
4084 D001932 Brain Neoplasms [C04.588.614.250.195, C10.228.140.211, C10.551... [Brain Neoplasms, Brain Cancer, Neoplasms, Int...
df
有几个这样的行。
如何将其转换为JSON格式,如下所示:
{
"id": 4084,
"Unique_ID": D001932,
"MeSH_heading": "Brain Neoplasms",
"tree_num": [
"C04.588.614.250.195",
"C10.228.140.211",
"C10.551"
]
}
有什么建议吗?谢谢!