title: How to define binary output for a classification model in Python
body: <p>I am predicting prediabetes with machine learning.</p>
  <p>I have x features and my output is prediabetes (yes or no)</p>
  <p>Prediabetes (LBXGH) is defined according to the range 5.7-6.4, so this range should be 1.
  The remaining values regarding this feature must be 0.</p>
  <p>I have tried many combinations where everyone has reported errors so far.</p>
  <p>This is where I am now:</p>
  <pre><code>df\[df\['LBXGH'\] \&gt;= 5.7 | \[df\['LBXGH'\] \&lt;= 6.4 \]\] = 1
  df\[df\['LBXGH'\] \&lt; 5.7 | \[df\['LBXGH'\] \&gt; 6.4\]\] = 0
  
  TypeError: unsupported operand type(s) for |: 'float' and 'list')
  </code></pre>
  <p>The goal is to have all values replaces with either 0 or 1 regarding to the constrains, so i can get futheron with the feature selection proces.</p>