pandas Read JSON


Example

can either pass string of the json, or a filepath to a file with valid json

In [99]: pd.read_json('[{"A": 1, "B": 2}, {"A": 3, "B": 4}]')
Out[99]:
   A  B
0  1  2
1  3  4

Alternatively to conserve memory:

with open('test.json') as f:
    data = pd.DataFrame(json.loads(line) for line in f)