[Numpy-discussion] another little index puzzle

Neal Becker ndbecker2@gmail....
Mon Jan 21 07:41:52 CST 2013


I have an array to be used for indexing.  It is 2d, where the rows are all the 
permutations of some numbers.  So:

array([[-2, -2, -2],
       [-2, -2, -1],
       [-2, -2,  0],
       [-2, -2,  1],
       [-2, -2,  2],
 ...
       [ 2,  1,  2],
       [ 2,  2, -2],
       [ 2,  2, -1],
       [ 2,  2,  0],
       [ 2,  2,  1],
       [ 2,  2,  2]])

Here the array is 125x3

I want to select all the rows of the array in which all the 3 elements are 
equal, so I can remove them.  So for example, the 1st and last row.





More information about the NumPy-Discussion mailing list