title: Create bool column based on bool and float condition in pandas
body: <p>I am trying to create. <code>bool</code> column in a dataframe with the following logic:</p>
  <p><code>df.a</code> = <code>bool</code> (0 or 1)</p>
  <p><code>df.start</code> = <code>float</code></p>
  <p><code>df.stop</code> = <code>float</code></p>
  <p>if <code>df.a</code> == 1 and if <code>df.start.shift(1) - df.stop &gt;= 5</code>, return 1, else return 0</p>
  <p>I am currently using this code:</p>
  <pre><code>    df['newColumn'] = (df['a'] &amp; (df['start'].shift(1) - df['stop']) &gt;= 5)
  
  </code></pre>
  <p>but I get this error:</p>
  <pre><code>TypeError: unsupported operand type(s) for &amp;: 'float' and 'float'
  </code></pre>
  <p>Here is a sample df:</p>
  <pre><code>a    start   stop
  0      .5    1.2
  1     1.5    2.2 
  1     2.3    2.9
  0     8.1    8.8
  0     17.9    18.1
  
  </code></pre>
  <p>which should be:</p>
  <pre><code>a    start   stop.  newColumn
  0      .5    1.2     0
  1     1.5    2.2     0
  1     2.3    2.9     1
  0     8.1    8.8     0
  0     17.9    18.1    0
  
  </code></pre>