[Numpy-discussion] numpy.array does not take generators

Alan G Isaac aisaac@american....
Thu Aug 16 21:04:11 CDT 2007


On Thu, 16 Aug 2007, Geoffrey Zhu apparently wrote:
> K=numpy.array(o[2]/1000.0 for o in opts)
> It does not work. 

K=numpy.fromiter((o[2]/1000.0 for o in opts),'float')

hth,
Alan Isaac






More information about the Numpy-discussion mailing list