[Numpy-discussion] trim_zeros in more than one dimension?

Andreas Hilboll lists at hilboll.de
Tue Apr 20 09:03:47 EDT 2010


Hi there,

is there an easy way to do something like trim_zeros() does, but for a
n-dimensional array? I have a 2d array with only zeros in the first and
last rows and columns, and would like to trim this array to only the
non-zero part ...

Thanks,

Andreas.




More information about the NumPy-Discussion mailing list