title: Check how many times value of column change when other column value is specific
body: <p>I have one dataframe with two columns A, and B . I want to check if column A value is greater than 5 continues, for this continuous time how many times value of column B value increase and how many times vaue decrease.</p>
  <pre><code>df = pd.DataFrame({'A':[1,3,8,6,7,11,1,15,20,15,16,87],
                   'B':[1,3,4,6,11,6,11,7,11,15,6,87,16]})
   df_out = pd.DataFrame({'values increase count':[5],
                       'values decrease count':[3]})
  </code></pre>