Is there any neat way of checking this is a numpy array surrounded by zeros.
Example:
[[0,0,0,0],
[0,1,2,0],
[0,0,0,0]]
I know I can repeat his wise element to find out, but I wonder if there is any good trick we can use here. The numpy array has float, nxm of arbitrary size.
Any ideas are welcome.
ad1v7 source
share