0

How to check for a given NumPy array of any dimension (1D, 2D, or 3D) if it contains any zero floating point value (0.0). For example, this 2D array:

[[0.07181809 0.76638862 0.0]
 [0.93566192 0.13161751 0.85768675]]

Is there any function that check for above condition and return True. Thanks for the help.

U12-Forward
  • 65,118
  • 12
  • 70
  • 89
Akhmad Zaki
  • 357
  • 5
  • 22

1 Answers1

1

You can use :

my_numpy_array = numpy.array(
  [[0.07181809, 0.76638862, 0.0],
   [0.93566192, 0.13161751, 0.85768675]]
)
0.0 in my_numpy_array

See also: Check if single element is contained in Numpy Array.

senorleo
  • 19
  • 2