Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas to list of dicts

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #list #dicts
ADD COMMENT
Topic
Name
9+8 =