[Numpy-discussion] Segfault when indexing on second or higher dimension with list or tuple

Albert Strasheim fullung at gmail.com
Thu Apr 13 05:18:04 CDT 2006

Hello all,

The following segfault bug was discovered in NumPy by 
someone at our Python workshop:

import numpy as N
F = N.zeros((1,1))
F[:,[0]] = 0

The following also segfaults:

F[:,(0,)] = 0

Something seems to go wrong when one uses a tuple or a list to index 
into a NumPy array on the second or higher dimension, since the 
following code works:

F = N.zeros((1,))
F[[0]] = 0

The Trac ticket is here:


If someone gets around to fixing this, please include some test cases.




More information about the Numpy-discussion mailing list