bug in vectorize? (was: Re: Casting a float array into a string array)
5 Oct
2007
5 Oct
'07
9: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
6216
Age (days ago)
6216
Last active (days ago)
0 comments
1 participants
participants (1)
-
Anne Archibald