【发布时间】:2019-10-22 19:44:35
【问题描述】:
我正在尝试从 mongoDB 集合转储创建数据框。
我已经参考了这个question 来规范化我的数据,但它不包含t help. The output doesnt 包含文件名和ID。
我想在我的数据框中包含文件名和 ID。
这是我的 json 示例
[
{'FileName': '32252652D.article.0018038745057751440210.tmp',
'_id': {'$oid': '5ced0669acd01707cbf2ew33'},
'section_details': [{'content': 'Efficient Algorithms for Non-convex Isotonic '
'Regression through Submodular Optimization ',
'heading': 'title'},
{'content': 'We consider the minimization of submodular '
'functions subject to ordering constraints. We show that '
'this potentially non-convex optimization problem can '
'be cast as a convex optimization problem on a space of '
'uni-dimensional measures',
'heading': 'abstract'},
{'content': '', 'heading': 'subject'},
{'content': ' Introduction to convex optimization'
'with mean ',
'heading': 'Content'}]},
{'FileName': '32252652D.article.0018038745057751440210.tmp',
'_id': {'$oid': '5ced0669acd01707cbf2ew11'},
'section_details': [{'content': 'Text-Adaptive Generative Adversarial Networks: '
'Manipulating Images with Natural Language ',
'heading': 'title'},
{'content': 'This paper addresses the problem of manipulating '
'images using natural language description. Our '
'task aims to semantically modify visual '
'attributes of an object in an image according '
'to the text describing the new visual',
'heading': 'abstract'},
{'content': '', 'heading': 'subject'},
{'content': ' Introduction to Text-Adaptive Generative Adversarial Networks',
'heading': 'Content'}]}
]
预期输出
【问题讨论】:
-
你的预期输出是什么?
标签: python json mongodb pandas