title: pandas multiple conditions based on multiple columns
body: <p>I am trying to color points of a pandas dataframe depending on TWO conditions. Example:</p>
  <pre class="lang-none prettyprint-override"><code>IF value of col1 &gt; a AND value of col2 - value of col3 &lt; b THEN value of col4 = string
  ELSE value of col4 = other string.
  </code></pre>
  <p>I have tried so many different ways now and everything I found online was only depending on one condition.</p>
  <p>My example code always raises the Error:</p>
  <pre class="lang-none prettyprint-override"><code>The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  </code></pre>
  <p>Here's the code. Tried several variations without success.</p>
  <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame()
  
  df['A'] = range(10)
  df['B'] = range(11,21,1)
  df['C'] = range(20,10,-1)
  
  borderE = 3.
  ex = 0.
  
  #print df
  
  df['color'] = np.where(all([df.A &lt; borderE, df.B - df.C &lt; ex]), 'r', 'b')
  </code></pre>
  <p>Btw: I understand, what it says but not how to handle it.</p>