title: Compare values between rows in pandas python
body: <p><a href="https://i.stack.imgur.com/Igstn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Igstn.png" alt="enter image description here" /></a></p>
  <p>I am new to pandas and I want to compare rows an then only enter into another for loop</p>
  <pre><code>for i in node:
      
      
      temp_df=df[(df['NODE'])==i]
      
      min_time=min(temp_df['time1'])
      max_time=max(temp_df['time1'])
      while min_time&lt;=max_time:
          print(min_time)
          df['No.Of_CellDown']=temp_df['time1'].between(min_time,min_time + timedelta(minutes=5)).sum()
          print(count)
          min_time=min_time + timedelta(minutes=5)
  </code></pre>
  <p>I want to update conditions to check if Tech and Issue column has same value for row and row(-1)
  and then proceed to execute for loop in the given code</p>