What would be the best way to remove the maximum from a cube and "collapse" the 
remaining elements along the z-axis ?
For example, I want to reduce Cube to NewCube:


>>> Cube
array([[[  13,   2,   3,  42],
        [  5, 100,   7,   8],
        [  9,   1,  11,  12]],

       [[ 25,   4,  15,   1],
        [ 17,  30,   9,  20],
        [ 21,   2,  23,  24]],

       [[ 1,   2,  27,  28],
        [ 29,  18,  31,  32],
        [ -1,   3,  35,   4]]])


NewCube

array([[[  13,   2,   3,  1],
        [  5, 30,   7,   8],
        [  9,   1,  11,  12]],

       [[ 1,   2,  15,  28],
        [ 17,  18,  9,  20],
        [ -1,   2,  23,   4]]])

I tried with argmax() and then roll() and delete() but these
all work on 1-D arrays only. Thanks.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to