title: Replacing elements in a numpy array when there are multiple conditions
body: <p>This question is related to the following post: <a href="https://stackoverflow.com/questions/19766757/replacing-numpy-elements-if-condition-is-met">Replacing Numpy elements if condition is met</a>.</p>
  
  <p>Suppose i have two, one-dimensional numpy arrays <code>a</code> and <code>b</code>, with 50 rows each.</p>
  
  <p>I would like to create an array <code>c</code> of 50 rows, each of which will take the values 0-4 depending on whether a condition is met:</p>
  
  <pre><code>if a &gt; 0 the value in the corresponding row of c should be 0
  if a &lt; 0 the value in the corresponding row of c should be 1
  if a &gt; 0 and b &lt; 0 the value in the corresponding row of c should be 2
  if b &gt; 0 the value in the corresponding row of c should be 3
  </code></pre>
  
  <p>I suppose the broader question here is how can i assign specific values to an
  array when there are multiple conditions. I have tried variations from the post i referenced above but i have not been successful. </p>
  
  <p>Any ideas of how i could achieve this, preferably without using a
  for-loop?</p>