title: Counting the number of consecutive values that meets a condition (Pandas Dataframe)
body: <p>So I created <a href="https://stackoverflow.com/questions/52629219/iterrating-in-dataframe-and-writing-down-the-index-of-the-values-where-a-conditi">this</a> post regarding my problem 2 days ago and got an answer thankfully.</p>
  
  <p>I have a data made of 20 rows and 2500 columns. Each column is a unique product and rows are time series, results of measurements. Therefore each product is measured 20 times and there are 2500 products.</p>
  
  <p>This time I want to know for how many consecutive rows my measurement result can stay above a specific threshold. 
  AKA: I want to count the number of <strong>consecutive</strong> values that is above a value, let's say 5.</p>
  
  <p>A = [1, 2, <strong>6</strong>, <strong>8</strong>, <strong>7</strong>, 3, 2, 3, <strong>6</strong>, <strong>10</strong>, 2, 1, 0, 2]
  We have these values in bold and according to what I defined above, I should get NumofConsFeature = 3 as the result. (Getting the max if there are more than 1 series that meets the condition)</p>
  
  <p>I thought of filtering using .gt, then getting the indexes and using a loop afterwards in order to detect the consecutive index numbers but couldn't make it work.</p>
  
  <p>In 2nd phase, I'd like to know the index of the first value of my consecutive series. For the above example, that would be 3.
  But I have no idea of how for this one.</p>
  
  <p>Thanks in advance. </p>