From: Tom D. <tom...@al...> - 2006-10-25 18:53:40
|
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) |