title: Update elements of array according to other array in one line?
body: <p>I have two arrays called y and R(same dimensions). R consists of 1 and 0's. I am trying to change y's elements to 0 if according element of R is 0, otherwise keep it same.
  I attempted this one line:</p>
  
  <pre><code>y=[0 for a in y if for b in r if b==0]
  </code></pre>
  
  <p>but it says invalid syntax. How should I change it?</p>