[Numpy-discussion] Array bug with character (regression from 1.4.0)

Ryan May rmay31 at gmail.com
Sat Mar 20 14:24:56 EDT 2010


The following code, which works with numpy 1.4.0, results in an error:

In [1]: import numpy as np
In [2]: v = 'm'
In [3]: dt = np.dtype('>c')
In [4]: a = np.asarray(v, dt)

On 1.4.0:

In [5]: a
Out[5]:
array('m',
      dtype='|S1')
In [6]: np.__version__
Out[6]: '1.4.0'

On SVN trunk:

/home/rmay/.local/lib/python2.6/site-packages/numpy/core/numeric.pyc
in asarray(a, dtype, order)
    282
    283     """
--> 284     return array(a, dtype, copy=False, order=order)
    285
    286 def asanyarray(a, dtype=None, order=None):

ValueError: assignment to 0-d array

In [5]: np.__version__
Out[5]: '2.0.0.dev8297'

Thoughts?
(Filed at: http://projects.scipy.org/numpy/ticket/1436)

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma



More information about the NumPy-Discussion mailing list