title: how does this sort of python indexing: 'print(X_train[y_train == 0][0])' work in python?
body: <p>I've training data X_train with #sample=60,000 and #features=784. And corresponding labels y_train with len(y_train)=60,000. </p>
  
  <p>I am not getting how is the following piece of code working:</p>
  
  <pre><code>print(X_train[y_train == 0][0])
  </code></pre>
  
  <p>It's basically the indexing that I'm not getting.
  <br> I tried the following to understand it(considering what y_train==0 would result into.):</p>
  
  <p><code>print(X_train[False True False False][0])</code> <br><br>
  but it's resulting into errors. Any guide will be appreciated. </p>
  
  <p>here's the output: <a href="https://i.stack.imgur.com/2wOwl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2wOwl.png" alt="enter image description here"></a></p>