mysql -> record array

Pierre GM pgmdevlist at gmail.com
Tue Nov 14 17:33:15 CST 2006


John,
I just added the following to your example:
...................................
tnow = time.time()
y = numpy.fromiter((tuple(i) for i in x), dtype=[('a',numpy.float_), ('b', 
numpy.float_)])
tdone = time.time()
print 'Numpy.fromiter %1.2f elapsed seconds'%(tdone - tnow)
...................................
Here are my results
with dtype: 4.43 elapsed seconds
w/o dtype 5.78 elapsed seconds
Numeric  1.17 elapsed seconds
Numpy.fromiter 0.62 elapsed seconds
23.7
1.0

Numpy, one point.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Numpy-discussion mailing list