title: If condition cannot evaluate multiple "True"s - Python
body: <p>I have 3D numpy array called <code>BNodeVal</code>. Currently its size is <code>(1,1,16)</code>, but it can be bigger than this. I am trying to evaluate an <code>if</code> condition using this 3D array and 3 coordinates <code>coord_x , coord_y, coord_z</code>. </p>
  
  <p><code>BNodeVal = [[[ 0.      1.     15.      0.      0.     13.4     1.77   15.9
      1.77   37.391   1.03   40.931  39.161   0.5402  0.      0.    ]]]</code></p>
  
  <p>Below is that portion of the code that is not working correctly: </p>
  
  <pre><code>for j in range(int(np.amax(BNodeval[i, :, 1]))):
      print("x = ", coord_x, "\ny =", coord_y, "\nz =", coord_z)
      print("3 = ", BNodeval[i][j][2], "\n4 =", BNodeval[i][j][3], "\n5 =", BNodeval[i][j][4])
      print(np.isclose(coord_x, BNodeval[i][j][2]))
      print(np.isclose(coord_y, BNodeval[i][j][3]))
      print(np.isclose(coord_z, BNodeval[i][j][4]))
  
      if np.isclose(coord_x, BNodeval[i][j][2]) and \
         np.isclose(coord_y, BNodeval[i][j][3]) and \
         np.isclose(coord_x, BNodeval[i][j][4]) :  # 1 - 1
          print("# 1 - 1")
      else:
          print('# 1 - 2")
  </code></pre>
  
  <p>This is what it is printing : </p>
  
  <pre><code>x =  15.0 
  y = 0.0 
  z = 0.0
  3 =  15.0 
  4 = 0.0 
  5 = 0.0
  True
  True
  True
  # 1 - 2
  </code></pre>
  
  <p>However, if i only use one of the <code>np.isclose</code> terms, it just work fine and print <code># 1 - 2</code> instead. Any suggestion is appreciated. </p>