In a 64-bit (linux) OS, if the numpy/scipy arrays are defined as 32-bit objects then the outputs are 32-bit. However, argpartsort returns a data object of 64-bit indices.
In a 32-bit (windows) OS, argpartsort returns a data object of 32-bit indices which is correct.
>>> import numpy
>>> from scipy import sparse
>>> import bottleneck
>>> row = numpy.array([0,0,1,2,2,2], dtype=numpy.int32)
>>> col = numpy.array([0,2,2,0,1,2], dtype=numpy.int32)
>>> data = numpy.array([1,2,3,4,5,6], dtype=numpy.int32)
>>> A = sparse.csr_matrix((data,(row,col)), shape=(3,3), dtype=numpy.float32)
>>> x = numpy.array([8.0, 4.0, 2.0], dtype=numpy.float32)
>>> b = A * x.T
>>> b
array([ 12., 6., 64.], dtype=float32)
>>> c = bottleneck.argpartsort(b, 2)
>>> c
array([1, 0, 2])
>>> type(c[0])
<type 'numpy.int64'>
>>> d = numpy.argsort(b)
>>> d
array([1, 0, 2])
>>> type(d[0])
<type 'numpy.int64'>
--
You received this message because you are subscribed to the Google Groups "bottle-neck" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottle-neck...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.