Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Bug in sorting structured numpy array with more than 2^31 elements #427
When using structured arrays of size more than 2^31, sorting doesn't work. The
import numpy as np dt = "u4, u4" a = np.empty(2 ** 31, dtype=dt) a["f0"][:] = np.random.randint(1, 1e9, 2 ** 31) a["f1"][:] = np.random.randint(1, 1e9, 2 ** 31) a.sort(order=["f0", "f1"]) for i in xrange(len(a) -1): u1, v1 = a[i] u2, v2 = a[i + 1] assert u1 < u2 or (u1 == u2 and v1 <= v2)
The above has been tested using Python 2.7 and Numpy version 1.6.2 as well as
I have the same problem with sort, and the all three kinds do not work.
GNU gdb (GDB) 7.1-ubuntu
Program received signal SIGSEGV, Segmentation fault.
Nice catch! Would you mind preparing a pull request? The correct datatype for