这是将JSON数据集加载到Pandas DataFrames中的最有效的方式 [英] which is the most efficient way of loading a JSON dataset into Pandas DataFrames

查看:96
本文介绍了这是将JSON数据集加载到Pandas DataFrames中的最有效的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Pandas文档和食谱(在CSV中只提及带分隔符的文本文件)中没有找到任何内容。

I didn't find anything in the Pandas documentations and cookbook (just references to CSV, and text files with separators) on JSON.

有没有已经定义的函数将JSON直接加载到DataFrame?如果有不同的选择,哪个是最有效的?

Is there an already defined function to load JSON directly into DataFrame? If there are different alternatives, which is the most efficient?

推荐答案

与熊猫0.12:

import pandas as pd

d = pd.read_json('JSON File')

这篇关于这是将JSON数据集加载到Pandas DataFrames中的最有效的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆