python list of dict to dataframe

25

# Supposing d is your list of dicts, simply
df = pd.DataFrame(d)
# Note: this does not work with nested data
In [20]: timeit df.T.to_dict().values()
1000 loops, best of 3: 395 µs per loop

In [21]: timeit df.to_dict('records')
10000 loops, best of 3: 53 µs per loop

Comments

Submit
0 Comments