[Numpy-discussion] Array bug with character (regression from 1.4.0)
Sun Mar 21 17:08:35 CDT 2010
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'
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.
More information about the NumPy-Discussion