lexsort in numpy crashing on strings

Tom Denniston tom.denniston at alum.dartmouth.org
Wed Oct 25 14:53:37 EDT 2006


Hi, I've been using the lexsort and it is really nice.  Much simpler and
faster than the implementation I had before.   The only problem is it seems
to crash on strings.

Do I just need to upgrade numpy or is it a current bug?
   In [2]: import numpy
   nu
   In [3]: numpy.array(['a', 'b', 'c'])
   Out[3]:
   array([a, b, c],
         dtype='|S1')
   In [4]: strArray = numpy.array(['a', 'b', 'c'])
   In [5]: intArray = numpy.array([1,2,3])
   In [6]: numpy.__version__
   Out[6]: '1.0b5'
   In [7]: numpy.lexsort((intArray,))
   Out[7]: array([0, 1, 2])
   In [8]: numpy.lexsort((intArray,intArray))
   Out[8]: array([0, 1, 2])
   In [9]: numpy.lexsort((strArray,intArray))
   Segmentation fault (core dumped)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061025/c656960a/attachment.html>
-------------- next part --------------
_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user


More information about the NumPy-Discussion mailing list