如何将嵌套字典列表(包括嵌套列表)转换为pandas数据框?

时间:2019-01-10 01:39:45

标签: python arrays

假设我的数据如下:

[[{'customers': [{'habits': [{'gaming': True,
   'skiing': False,
   'location': [{'state': 'WA',
     'zipcode': 94129},
    {'filename': '//customers/seat/seattle/94129', 'lineIndex': 27}],
   'refund_applied': False,
   'customer_service': False}],
 'name': 'alex187'},
 {'habits': [{'gaming': False,
   'skiing': False,
   'location': [{'state': 'WA',
     'zipcode': 94129},
    {'filename': '//customers/seat/seattle/94129', 'lineIndex': 32}],
   'refund_applied': False,
   'customer_service': False}],
 'name': 'john456'}],
'stores': {'grocery': 'kirkland/costco'}}]]

并且需要包含这些列的数据框grocery, filename, lineIndex, state, zipcode, name, gaming, skiing, refund_applied, customer_service。是否有python函数可以帮助我完成这项工作?

谢谢!

0 个答案:

没有答案