title: pandas groupby and agg operation of selected columns and row
body: <p>I have a dataframe as below:</p>
  
  <p><a href="https://i.stack.imgur.com/ivarC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ivarC.png" alt="enter image description here"></a></p>
  
  <p>I am not sure if it is possible to use pandas to make an output as below:</p>
  
  <p>difference=Response[df.Time=="pre"]-Response.min for each group</p>
  
  <p><a href="https://i.stack.imgur.com/I0DnV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I0DnV.png" alt="enter image description here"></a></p>