title: NumPy - Set values in structured array based on other values in structured array
body: <p>I have a structured NumPy array:</p>
  
  <pre><code>a = numpy.zeros((10, 10), dtype=[
      ("x", int),
      ("y", str)])
  </code></pre>
  
  <p>I want to set values in <code>a["y"]</code> to either <code>"hello"</code> if the corresponding value in <code>a["x"]</code> is negative. As far as I can tell, I should be doing that like this:</p>
  
  <pre><code>a["y"][a["x"] &lt; 0] = "hello"
  </code></pre>
  
  <p>But this seems to change the values in <code>a["x"]</code>! What is the problem with what I'm doing, and how else should I do this?</p>