[Numpy-discussion] bug in vectorize? (was: Re: Casting a float array into a string array)
Fri Oct 5 16:39:28 CDT 2007
On 05/10/2007, Christopher Barker <Chris.Barker@noaa.gov> wrote:
> I don't know how to generalize this to n-d though -- maybe numpy.vectorize?
Oops! Looks like there's a big somewhere:
In : from numpy import *
In : vectorize(lambda x: "%5.3g" % x)(ones((2,2,2)))
array([[[' ', '\xc1'],
[' ', '\xc1']],
[[' ', '\xc1'],
[' ', '\xc1']]],
In : vectorize?
Segmentation fault (core dumped)
In particular, vectorize creates a string array (rather than an object
array), and some unsafe operation is done on that array.
More information about the Numpy-discussion