¡@

Home 

python Programming Glossary: mtimeit

Python List Comprehension Vs. Map

http://stackoverflow.com/questions/1247486/python-list-comprehension-vs-map

of map when using exactly the same function python mtimeit s'xs range 10 ' 'map hex xs ' 100000 loops best of 3 4.86 usec.. hex xs ' 100000 loops best of 3 4.86 usec per loop python mtimeit s'xs range 10 ' ' hex x for x in xs ' 100000 loops best of 3.. gets completely reversed when map needs a lambda python mtimeit s'xs range 10 ' 'map lambda x x 2 xs ' 100000 loops best of..

Python string 'join' is faster(?) than '+', but what's wrong here?

http://stackoverflow.com/questions/1349311/python-string-join-is-faster-than-but-whats-wrong-here

more meaningful and interesting set of measurements python mtimeit s'r str x 99 for x in xrange 100 1000 ' 's .join r ' 1000 loops.. about having to do appends before then. But python mtimeit s'r str x 99 for x in xrange 100 1000 ' 's ' 'for x in r s x'.. x in r s x' 1000 loops best of 3 779 usec per loop python mtimeit s'r str x 99 for x in xrange 100 1000 ' 'z ' 'for x in r z.append..

Why program functionally in Python?

http://stackoverflow.com/questions/1892324/why-program-functionally-in-python

the product of a list. Oh really Let's see... python mtimeit s'L range 12 52 ' 'reduce lambda x y x y L 1 ' 100000 loops.. x y L 1 ' 100000 loops best of 3 18.3 usec per loop python mtimeit s'L range 12 52 ' 'p 1' 'for x in L p x' 100000 loops best of.. further sacrificing compactness and readability... python mtimeit s'import operator L range 12 52 ' 'reduce operator.mul L 1 '..

Fastest way to list all primes below N in python

http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python

29.3 Timings were measured using the command python mtimeit s import primes primes. method 10000000 with method replaced..

Python: removing duplicates from a list of lists

http://stackoverflow.com/questions/2213923/python-removing-duplicates-from-a-list-of-lists

Now we can run checks on the tiny example list python mtimeit s'import nodup' 'nodup.doset nodup.k ' 100000 loops best of.. nodup.k ' 100000 loops best of 3 11.7 usec per loop python mtimeit s'import nodup' 'nodup.dosort nodup.k ' 100000 loops best of.. nodup.k ' 100000 loops best of 3 9.68 usec per loop python mtimeit s'import nodup' 'nodup.dogroupby nodup.k ' 100000 loops best..

Making a flat list out of list of lists in Python [duplicate]

http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python

can use the timeit module in the standard library python mtimeit s'l 1 2 3 4 5 6 7 8 9 99' ' item for sublist in l for item in.. sublist ' 10000 loops best of 3 143 usec per loop python mtimeit s'l 1 2 3 4 5 6 7 8 9 99' 'sum l ' 1000 loops best of 3 969.. 99' 'sum l ' 1000 loops best of 3 969 usec per loop python mtimeit s'l 1 2 3 4 5 6 7 8 9 99' 'reduce lambda x y x y l ' 1000 loops..