title: Python multidimensional array indexing explanation
body: <p>Could someone please explain to me what is happening here? I understand what is happening here: <a href="https://docs.scipy.org/doc/numpy-1.15.0/user/basics.indexing.html#index-arrays" rel="nofollow noreferrer">https://docs.scipy.org/doc/numpy-1.15.0/user/basics.indexing.html#index-arrays</a>, but do not understand this piece of code.</p>
  
  <pre><code>import numpy as np
  y = np.zeros((3,3))
  y = y.astype(np.int16)
  y[1,1] = 1
  x = np.ones((3,3))
  t = (1-y).astype(np.int16)
  print(t)
  print(x[t])
  x[(1-y).astype(np.int16)] = 0
  print(x)
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>[[1 1 1]
   [1 0 1]
   [1 1 1]]
  
  [[[1. 1. 1.]
    [1. 1. 1.]
    [1. 1. 1.]]
  
   [[1. 1. 1.]
    [1. 1. 1.]
    [1. 1. 1.]]
  
   [[1. 1. 1.]
    [1. 1. 1.]
    [1. 1. 1.]]]
  
  [[0. 0. 0.]
   [0. 0. 0.]
   [1. 1. 1.]]
  </code></pre>