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

Alan G Isaac aisaac at american.edu
Thu Aug 16 22:04:11 EDT 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