title: Python-pandas: the truth value of a series is ambiguous error
body: <p>in pandas_dataframe, I try to convert numerical value to categorical value</p>
  <pre><code>df['SalePrice_band']=0
  df.loc[df['SalePrice']&lt;50000 , 'SalesPrice_band']=1
  df.loc[df['SalePrice']&gt;=50000 &amp; df['SalePrice']&lt;100000 , 'SalesPrice_band'] = 2
  df.loc[df['SalePrice']&gt;=100000 &amp; df['SalePrice']&lt;125000 , 'SalesPrice_band'] = 3
  df.loc[df['SalePrice']&gt;=125000 &amp; df['SalePrice']&lt;150000 , 'SalesPrice_band'] = 4
  df.loc[df['SalePrice']&gt;=150000 &amp; df['SalePrice']&lt;175000 , 'SalesPrice_band'] = 5
  </code></pre>
  <p>But, above code occurs error as
  : ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  <p>so, I read error message and checked</p>
  <pre><code>df.loc[df['SalePrice']&lt;50000 , 'SalesPrice_band']=1
  </code></pre>
  <p>Above is fine.</p>
  <pre><code> df['SalePrice']&gt;=50000 &amp; df['SalePrice']&lt;100000
  </code></pre>
  <p>But Here , I got error where I connect by two bool_bin</p>
  <p>SO, I TRY Like this :</p>
  <pre><code>(df['SalePrice']&gt;=50000 &amp; df['SalePrice']&lt;100000).all()
  </code></pre>
  <p>But DOESN'T WORK; Still error : ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  <p>How can I handle it?</p>