Integer From A Float List?!?

andrea_gavana at tin.it andrea_gavana at tin.it
Sat Mar 5 07:42:59 EST 2005


Hello NG,

    sorry to bother you again with this question... I never used the "timeit"
function, and I would like to ask you if the call I am doing is correct:

C:\Python23\Lib>python timeit.py -n 1000 -s "from Numeric import ones" -s
 "floa
ts=ones((1000,1),'f')" -s "ints = floats.astype(int)"
1000 loops, best of 3: 0.0536 usec per loop

I used Numeric module to create a 1000 floats matrix of ones, and it seems
to me that is a lot faster than other solutions... but probably I am doing
something wrong in my call to the timeit function...

Thank you a lot.

Andrea.




More information about the Python-list mailing list