title: Comparing percent changed to previous row in pandas DataFrame
body: <p>I am working with a particularly big dataframe which contains a lot of raw data. I think I have managed to convert the row I am interested in into percent changed with the pct_changed() and inserted it into a new column in the dataframe.</p>
  
  <p>From there I want to compare each row, and get out a result only if the percent exceeds 2%. I tried with conditionals but it printed out a line for each row I had. Here is the code I am working with:</p>
  
  <pre><code>import pandas as pd
  
  df=pd.read_csv("tempcsv.csv")
  percentile = df['Pressure'].pct_change().fillna(0)
  
  for row in percentile:
      if row &gt; 2:
          print("Above")
  </code></pre>
  
  <p>What I am trying to do is to store the amount of returned "aboves", into a variable which I can use later on. I am pretty new to python so I am learning as I go.</p>
  
  <p>I hope this is explained well enough!</p>
  
  <p>PS: Would it also be possible to take out the median of each 10 rows?</p>