¡@

Home 

python Programming Glossary: msec

timeit versus timing decorator

http://stackoverflow.com/questions/1622943/timeit-versus-timing-decorator

i 31 for i in range 0 len alist 31 ' 10 loops best of 3 64 msec per loop python m timeit s 'from itertools import izip' 'alist.. iter alist x for x in izip i 31 ' 10 loops best of 3 66.5 msec per loop Using timeit the results are virtually the same but..

Iterate over the lines of a string

http://stackoverflow.com/questions/3054604/iterate-over-the-lines-of-a-string

s'import asp' 'list asp.f2 ' 1000 loops best of 3 1.36 msec per loop python mtimeit s'import asp' 'list asp.f1 ' 10000 loops..

check if all elements in a list are identical

http://stackoverflow.com/questions/3844801/check-if-all-elements-in-a-list-are-identical

checkEqual3 checkEqualIvo checkEqual6502 s1 1.19 msec 348 usec 183 usec 51.6 usec 121 usec s2 1.17 msec 376 usec 185.. s1 1.19 msec 348 usec 183 usec 51.6 usec 121 usec s2 1.17 msec 376 usec 185 usec 50.9 usec 118 usec s3 4.17 usec 348 usec 120.. s3 4.17 usec 348 usec 120 usec 264 usec 61.3 usec s4 1.73 msec 182 usec 50.5 usec 121 usec s5 1.71 msec 181 usec 50.6 usec..

Python: Extract numbers from a string

http://stackoverflow.com/questions/4289331/python-extract-numbers-from-a-string

s for s in str.split if s.isdigit 100 loops best of 3 2.84 msec per loop python m timeit s import re str 'h3110 23 cat 444.4.. dog' 1000 re.findall ' b d b' str 100 loops best of 3 5.66 msec per loop This will not recognise floats negative integers or..

Good way to append to a string

http://stackoverflow.com/questions/4435169/good-way-to-append-to-a-string

s '' for i in xrange 10000 s 'a' 1000 loops best of 3 1.71 msec per loop python m timeit s s '' for i in xrange 100000 s 'a'.. s '' for i in xrange 100000 s 'a' 10 loops best of 3 14.6 msec per loop python m timeit s s '' for i in xrange 1000000 s 'a'.. s '' for i in xrange 1000000 s 'a' 10 loops best of 3 173 msec per loop It's important however to note that this optimisation..

Is it possible to specify your own distance function using Scikits.Learn K-Means Clustering?

http://stackoverflow.com/questions/5529625/is-it-possible-to-specify-your-own-distance-function-using-scikits-learn-k-means

kmdelta maxiter kmiter metric metric verbose 2 print .0f msec time t0 1000 # also ~ py np kmeans test kmeans.py Some notes..

Convert RGBA PNG to RGB with PIL

http://stackoverflow.com/questions/9166400/convert-rgba-png-to-rgb-with-pil

results but alpha_composite_with_color is much faster 8.93 msec than pure_pil_alpha_to_color 79.6 msec . If numpy is available.. is much faster 8.93 msec than pure_pil_alpha_to_color 79.6 msec . If numpy is available on your system that's the way to go... i2 utils.alpha_to_color i 10 loops best of 3 4.67 msec per loop python m timeit import Image from apps.front import..

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

9 99' 'reduce lambda x y x y l ' 1000 loops best of 3 1.1 msec per loop Explanation the shortcuts based on including the implied..