Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将Facebook Graph API insights JSON转换为熊猫数据框架_Python_Pandas - Fatal编程技术网

Python 将Facebook Graph API insights JSON转换为熊猫数据框架

Python 将Facebook Graph API insights JSON转换为熊猫数据框架,python,pandas,Python,Pandas,我试图从Facebook graph API中读取我的页面见解,然后将其转换为pandas dataframe,但无法做到这一点 我使用了json_规范化函数,但没有帮助我 这是我的JSON [{'name': 'page_impressions', 'period': 'day', 'values': [{'value': 0, 'end_time': '2020-01-02T08:00:00+0000'}, {'value': 0, 'end_t

我试图从Facebook graph API中读取我的页面见解,然后将其转换为pandas dataframe,但无法做到这一点

我使用了json_规范化函数,但没有帮助我

这是我的JSON

    [{'name': 'page_impressions',
      'period': 'day',
      'values': [{'value': 0, 'end_time': '2020-01-02T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-03T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-04T08:00:00+0000'},
       {'value': 0, 'end_time': '2020-01-05T08:00:00+0000'},
       ],
      'title': 'Daily Total Impressions',
      'description': "Daily: The number of times any content from your Page or about your Page entered a person's screen. This includes posts, stories, check-ins, ads, social information from people who interact with your Page and more. (Total Count)",
      'id': '761993803915367/insights/page_impressions/day'},
     {'name': 'page_fans',
      'period': 'day',
      'values': [{'value': 587, 'end_time': '2020-01-02T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-03T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-04T08:00:00+0000'},
       {'value': 587, 'end_time': '2020-01-05T08:00:00+0000'}],

      'title': 'Lifetime Total Likes',
      'description': 'Lifetime: The total number of people who have liked your Page. (Unique Users)',
      'id': '761993803915367/insights/page_fans/day'}]
数据帧中的预期输出样本

page_impressions  | page_fans  |  end_time

 0                587       2020-01-03T08:00:00+0000