title: What Is the Function of Less Than (<) Operator in numpy Array?
body: <p>I'm learning Python right now and I'm stuck with this line of code I found on the internet. I can not understand what actually this line of code do. </p>
  
  <p>Suppose I have this array: <br></p>
  
  <pre><code>import numpy as np
  x = np.array ([[1,5],[8,1],[10,0.5]]
  y = x[np.sqrt(x[:,0]**2+x[:,1]**2) &lt; 1]
  print (y)
  </code></pre>
  
  <p>The result is an empty array. What I want to know is what does actually the <em>y</em> do? I've never encountered this kind of code before. It seems like the square brackets is like the <em>if-conditional</em> statement. Instead of that code, If write this line of code:</p>
  
  <pre><code>import numpy as np
  x = np.array ([[1,5],[8,1],[10,0.5]]
  y = x[0 &lt; 1]
  print (y)
  </code></pre>
  
  <p>It will return exactly what <em>x</em> is (because zero IS less than one). <br>
  Assuming that it is a way to write <em>if-conditional</em> statement, I find it really absurd because I'm comparing an array with an integer. <br>
  Thank you for your answer!</p>