[Numpy-tickets] [NumPy] #408: problem using chararray with argsort()

NumPy numpy-tickets at scipy.net
Fri Dec 22 09:35:49 CST 2006


#408: problem using chararray with argsort()
------------------------+---------------------------------------------------
 Reporter:  chanley     |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  numpy.core  |     Version:  devel   
 Severity:  normal      |    Keywords:          
------------------------+---------------------------------------------------
 The following works with numarray but not numpy.

 {{{

 NUMARRAY Example:
 >>> from numarray import strings as chararray
 >>> a = chararray.array(['a','b','c'])
 >>> index=a.argsort()
 >>> print index
 [0 1 2]
 >>>

 NUMPY Example:
 >>> from numpy import char
 >>> a = char.array(['a','b','c'])
 >>> index =a.argsort()
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/data/sparty1/dev/site-
 packages/lib/python/numpy/core/defchararray.py", line 43, in
 __array_finalize__
     raise ValueError, "Can only create a chararray from string data."
 ValueError: Can only create a chararray from string data.
 >>>
 >>> import numpy
 >>> numpy.__version__
 '1.0.2.dev3487'
 >>>
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/408>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list