Re: Multiplying all the values in a dictionary
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Multiplying all the values in a dictionary

From: Adam DePrince <adam.deprince@gmail.com>
Date: Fri Mar 24 2006 - 06:26:12 CET

Excuse me, I mean

 python2.4 -mtimeit -s 'from numarray import array; d =
{(100,500):[5,5], (100,501):[6,6],
(100,502):[7,7]}; x = dict(d);' 'for i in x.values():
 i[0]*=1;i[1]*=1'
1000000 loops, best of 3: 1.72 usec per loop

i[0]*=1, not j[0]*=1 ...
Received on Sun Apr 30 21:02:02 2006