title: Pandas: np.where with multiple conditions on dataframes
body: <p>hi folks i have look all over SO and google and cant find anything similar...</p>
  
  <p>I have a dataframe x (essentially consisting of one row and 300 columns) and another dataframe y with same size but different data. I would like to modify x such that it is 0 if it has a different sign to y AND x itself is not 0, else leave it as it is. so this requires the use of np.where with multiple conditions. However the multiple condition examples i've seen all use scalars, and when i use the same syntax it does not seem to work (ends up setting -everything- to zero, no error). i'm worried about assign-by-reference issues hidden somewhere or other (y is x after shifting but as far as i can tell there is no upstream issue above this code) any ideas?</p>
  
  <p>the code i am trying to debug is:</p>
  
  <pre><code>tradesmade[i:i+1] = np.where((sign(x) != sign(y)) &amp; (sign(x) != 0), 0, x) 
  </code></pre>
  
  <p>which just returns a bunch of zeros. I have also tried</p>
  
  <pre><code>tradesmade[i:i+1][(sign(x) != sign(y)) * (sign(x) != 0)] = 0
  </code></pre>
  
  <p>but this does not seem to work either. I have been at this for hours and am at a total loss. please help!</p>