title: create a new column based on multiple conditions in one column
body: <p>Step 1: I have a dataframe where I want to find the difference (df.series.diff()) of one element from another element in a column C .</p>
  
  <p>Step 2: If the element difference from step 1 meets a threshold of greater than 4 AND last more than 2 consecutive rows without decrease more than 2 than I want to flag it in a new column. </p>
  
  <p>Would like to get this outcome:</p>
  
  <pre><code>    A           B(time)    C(load)       D(New column with logic) 
    account 1     0            1           N        
    account 1     1:00         2.2         N   
    account 1     2:00         3.3         N
    account 1     3:00         9.6         N 
    account 1     4:00         10          Y
    account 1     5:00         12          Y 
    account 1     6:00         9           Y
    account 1     7:00         2.3         N
    account 1     8:00         6.5         N   
    account 1     9:00         7.0         Y
  </code></pre>
  
  <p>I've tried this so far but it does not work only the first part before the and: </p>
  
  <pre><code>    df['new']=df.load.diff(1).cumsum().ge(4) &amp; df.load.diff(1).le(2)
  </code></pre>