title: How to zero particular elements using a mask in python?
body: <p>I ran into a simple problem, where I wanted to assign values according to a mask that represents a position of elements in an array. For instance <code>array[*,1] = 0</code> but this code obviously would not work.</p>
  <p>After a little thought I have come up with this:</p>
  <pre><code>import numpy as np
  
  a = np.random.normal(size=(5, 2))
  
  print(a)
  print(a.shape)
  
  for i in np.arange(a.shape[0]):
      a[i][1] = 0
      
  print(a)
  print(a.shape)
  </code></pre>
  <p>But obviously, this awkward loop is not a pythonic way of doing that.</p>
  <p>So, can you share some neat ways of performing such operations in Python?</p>