2
我與格式化一樣低於許多嵌套字典的JSON響應工作:Python的JSON到大熊貓數據幀
{u'addresses': [],
u'application_ids': [20855193],
u'applications': [{u'answers': [{u'answer': u'Indeed ',
u'question': u'How did you hear?'}],
u'applied_at': u'2015-10-29T22:19:04.925Z',
u'candidate_id': 9999999,
u'credited_to': None,
u'current_stage': {u'id': 9999999,
u'name': u'Application Review'},
u'id': 9999999,
u'jobs': [{u'id': 9999999,u'name': u'ENGINEER'}],
u'last_activity_at': u'2015-10-29T22:19:04.767Z',
u'prospect': False,
u'rejected_at': None,
u'rejection_details': None,
u'rejection_reason': None,
u'source': {u'id': 7, u'public_name': u'Indeed'},
u'status': u'active'}],
u'attachments': [{u'filename': u'Jason_Bourne.pdf',
u'type': u'resume',
u'url': u'https://resumeURL'}],
u'company': None,
u'coordinator': {u'employee_id': None,
u'id': 9999999,
u'name': u'Batman_Robin'},
u'email_addresses': [{u'type': u'personal',
u'value': u'[email protected]'}],
u'first_name': u'Jason',
u'id': 9999999,
u'last_activity': u'2015-10-29T22:19:04.767Z',
u'last_name': u'Bourne',
u'website_addresses': []}
我試圖JSON的扁平化到一個表,並在發現下面的例子熊貓文檔:
http://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.io.json.json_normalize.html
出於某種原因,直接在「應用程序的報頭返回如每行的一個字符下任何數據。例如,如果我稱之爲:
timeapplied = json_normalize(data,['applications', ['applied_at']])
我得到:
0
0 2
1 0
2 1
3 5
4 -
5 1
6 0
7 -
8 2
9 9
10 T
11 2
12 2
13 :
14 1
15 9
16 :
17 0
18 4
19 .
20 9
21 2
22 5
23 Z
有沒有解決這個辦法,所以我可以使用normalize功能?
謝謝!
你想要的輸出是什麼? – Psidom