Hi Folks,

I have array (numpy.ndarray object) with non-zero elements cumulated
'somewhere' (like a array([[0,0,0,0],[0,1,1,0],[0,0,1,0],[0,0,0,0]]))
and I need sub-array with just non-zero elements
(array([[1,1],[0,1]])).
I can do this with iterating throught an array, but I also found some
magic tricks with boolen operators in indexing and nonzero function,
but it is still not clear to me, how to use it.

I am sure that this will be pretty easy for those who are familiar
with this kind of array indexing and I hope I will be one of them soon
:-).

Thanks a lot
Radek
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to