Answers for "numpy all values which are not zero"

1

numpy take out elements equal to zero

a[a != 0]
Posted by: Guest on July-08-2021
0

numpy check if an array is all zero

>>> all_zeros = not np.any(a)
Posted by: Guest on June-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language