[Numpy-discussion] Array bug with character (regression from 1.4.0)
Charles R Harris
Sun Mar 21 17:13:27 CDT 2010
On Sun, Mar 21, 2010 at 4:08 PM, Pauli Virtanen <firstname.lastname@example.org> wrote:
> Ryan May wrote:
> > The following code, which works with numpy 1.4.0, results in an error:
> Python 2.6, I presume?
> > In : import numpy as np
> > In : v = 'm'
> > In : dt = np.dtype('>c')
> > In : a = np.asarray(v, dt)
> > On SVN trunk:
> > ValueError: assignment to 0-d array
> > In : np.__version__
> > Out: '2.0.0.dev8297'
> > Thoughts?
> Nope, but it's likely my bad. Smells a bit like the dtype '>c' has size 0
> that doesn't get automatically adjusted in the array constructor, so you end
> up assigning size-1 string to size-0 array element... Which is strange sice
> I don't think this particular code path has been changed at all.
> One would have to follow the C execution path with gdb to find out what
> goes wrong.
I was wondering if this was related to Michael's fixes for character arrays?
A little bisection might help localize the problem.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion