title: Add row before first and after last position of every group in pandas
body: <p>i have a dataframe</p>
  
  <pre><code>value    id
  100       1
  200       1
  300       1
  500       2
  600       2
  700       3
  </code></pre>
  
  <p>i want to group by id and add row before 1st row and after last row of every group such that my dataframe looks:  i am adding row with value <code>0</code></p>
  
  <pre><code>value    id
  0         1
  100       1
  200       1
  300       1
  0         1
  0         2
  500       2
  600       2
  0         2
  0         3
  700       3
  0         3
  </code></pre>
  
  <p>Now for every group of id, i want to add sequence column such that:</p>
  
  <pre><code>value    id    sequence
  0         1    1
  100       1    2
  200       1    3
  300       1    4
  0         1    5
  0         2    1
  500       2    2
  600       2    3
  0         2    4
  0         3    1
  700       3    2
  0         3    3
  </code></pre>
  
  <p>the last part is easy but i am looking for how to add rows before and after every group?</p>