Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13981

How to split dictionary into multiple dictionaries fast

$
0
0

I have found a solution but it is really slow:

def chunks(self,data, SIZE=10000):    for i in xrange(0, len(data), SIZE):        yield dict(data.items()[i:i+SIZE])

Do you have any ideas without using external modules (numpy and etc.)


Viewing all articles
Browse latest Browse all 13981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>