I am dealing with arrays created via numpy.array(), and I need to draw points on a canvas simulating an image. Since there is a lot of zero values around the central part of
Something like:
empty_cols = sp.all(array == 0, axis=0) empty_rows = sp.all(array == 0, axis=1)
The resulting arrays will be 1D boolian arrays. Loop on them from both ends to find the 'bounding box'.