【问题标题】:How to expand (extract) information from highly nets JSON with Pandas如何使用 Pandas 从高度网络 JSON 中扩展(提取)信息
【发布时间】:2017-08-17 06:34:03
【问题描述】:

我正在使用 Pandas 读取 JSON 文件,我的一些行包含如下内容:

In[37]: df
Out[37]: 
66     {u'test_date': {u'$date': 1465513200000}, u'se...
81     {u'test_date': {u'$date': 1463958000000}, u'se...
155    {u'Nancy Index': 1, u'test_date': {u'$date': 1...
163    {u'Nancy Index': 2, u'test_date': {u'$date': 1...
213    {u'Nancy Index': 0, u'test_date': {u'$date': 1...
231    {u'Nancy Index': 0, u'test_date': {u'$date': 1...

有没有很好的 Pandas 函数可以处理这种嵌套数据?

【问题讨论】:

    标签: python json pandas nested


    【解决方案1】:

    jSon 文件有时嵌套很深。您可以再次序列化这些单元格值。

    这些序列化程序记录在 http://pandas.pydata.org/pandas-docs/stable/generated/pandas.io.json.json_normalize.html

    每个json文件都不一样;所以你必须通过结构自己工作。 Stack Overflow 上有几个很好的例子。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-10
      • 1970-01-01
      相关资源
      最近更新 更多