numpy periksa apakah array semuanya nol

>>> all_zeros = not np.any(a)
Obnoxious Oryx