title: Python Pandas DataFrames compare with next rows
body: <p>I have dataframe like this.</p>
  <pre><code>        col1  
      0     1
      1     3
      2     3
      3     1
      4     2
      5     3
      6     2
      7     2 
  </code></pre>
  <p>I want to create column out by compare each row. If row 0 less than row 1 then out is 1. If row 1 more than row 2 then out is 0. like this sample.</p>
  <pre><code>        col1  out  
      0     1   1     # 1&lt;3 = 1
      1     3   0     # 3&lt;3 = 0
      2     3   0     # 3&lt;1 = 0
      3     1   1     # 1&lt;2 = 1
      4     2   1     # 2&lt;3 = 1
      5     3   0     # 3&lt;2 = 0
      6     2   0     # 2&lt;2 = 0
      7     2   - 
  </code></pre>
  <p>I try with this code.</p>
  <pre><code>    def comp_out(a):
  
          return np.concatenate(([1],a[1:] &gt; a[2:]))
      
      df['out'] = comp_out(df.col1.values)
  </code></pre>
  <p>It show error like this.</p>
  <pre><code>ValueError: operands could not be broadcast together with shapes (11,) (10,) 
  </code></pre>