bug in vectorize? (was: Re: Casting a float array into a string array)

Oct. 5, 2007
2:39 p.m.
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 [1]: from numpy import * In [2]: vectorize(lambda x: "%5.3g" % x)(ones((2,2,2))) Out[2]: array([[[' ', '\xc1'], [' ', '\xc1']], [[' ', '\xc1'], [' ', '\xc1']]], dtype='|S1') In [3]: 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. Anne
6431
Age (days ago)
6431
Last active (days ago)
0 comments
1 participants
participants (1)
-
Anne Archibald