>>> a[(a != 0).all(axis=1)][:,(a != 0).all(axis=0)]
array([[ 1, 4, 5],
[11, 14, 15]])
Finding the elements of a that are non-zero is really easy:
>>> (a != 0)
array([[ True, True, True, True, True],
[ True, False, True, True, True],
[ True, True, True, True, True],
[ True, False, False, True, True]], dtype=bool)
And then you can just use all, specifying the axis, to find the rows you want to keep:
>>> (a != 0).all(axis=1)
array([ True, False, True, False], dtype=bool)
and the same thing for the columns:
>>> (a != 0).all(axis=0)
array([ True, False, False, True, True], dtype=bool)