title: Pandas, subtract values based on value of another column
body: <p>In Pandas, I'm trying to figure out how to generate a column that is the difference between the time of the current row and time of the last row in which the value of another column is True:</p>
  
  <p>So given the dataframe:</p>
  
  <pre><code>df = pd.DataFrame({'Time':[5,10,15,20,25,30,35,40,45,50],
              'Event_Occured': [True,False,False,True,True,False,False,True,False,False]})
  
  print df
  
    Event_Occured  Time
  0          True     5
  1         False    10
  2         False    15
  3          True    20
  4          True    25
  5         False    30
  6         False    35
  7          True    40
  8         False    45
  9         False    50
  </code></pre>
  
  <p>I'm trying to generate a column that would look like this:</p>
  
  <pre><code>  Event_Occured  Time  Time_since_last
  0          True     5                0
  1         False    10                5
  2         False    15               10
  3          True    20                0
  4          True    25                0
  5         False    30                5
  6         False    35               10
  7          True    40                0
  8         False    45                5
  9         False    50               10
  </code></pre>
  
  <p>Thanks very much!</p>
  
  <p>​</p>