title: Extend time series for each group in the panel
body: <p>I have the following database:</p>
  
  <pre><code>firm    sic     identifier  name                    year    X           Y           Z
  1078    2834.0  002824100   ABBOTT LABORATORIES     2013    4.347826    5.217391    15.739130   
  1078    2834.0  002824100   ABBOTT LABORATORIES     2014    4.368421    6.263158    16.684211   
  112178  2836.0  00339B107   ABGENIX INC             2005    5.222222    3.111111    9.777778    
  112178  2836.0  00339B107   ABGENIX INC             2006    5.222222    4.111111    10.777778     
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    4.000000    0.000000    13.544322   
  </code></pre>
  
  <p>My intention is to extend year variable 5 years backward for each group. Firm, sic, identifier and name columns will need to be copied to new rows. However, X, Y and Z columns will be NAN.    </p>
  
  <p>Intended outcome:</p>
  
  <pre><code>firm    sic     identifier  name                    year    X           Y           Z
  1078    2834.0  002824100   ABBOTT LABORATORIES     2008    NAN         NAN         NAN
  1078    2834.0  002824100   ABBOTT LABORATORIES     2009    NAN         NAN         NAN
  1078    2834.0  002824100   ABBOTT LABORATORIES     2010    NAN         NAN         NAN  
  1078    2834.0  002824100   ABBOTT LABORATORIES     2011    NAN         NAN         NAN
  1078    2834.0  002824100   ABBOTT LABORATORIES     2012    NAN         NAN         NAN
  1078    2834.0  002824100   ABBOTT LABORATORIES     2013    4.347826    5.217391    15.739130   
  1078    2834.0  002824100   ABBOTT LABORATORIES     2014    4.368421    6.263158    16.684211   
  112178  2836.0  00339B107   ABGENIX INC             2000    NAN         NAN         NAN 
  112178  2836.0  00339B107   ABGENIX INC             2001    NAN         NAN         NAN
  112178  2836.0  00339B107   ABGENIX INC             2002    NAN         NAN         NAN 
  112178  2836.0  00339B107   ABGENIX INC             2003    NAN         NAN         NAN 
  112178  2836.0  00339B107   ABGENIX INC             2004    NAN         NAN         NAN 
  112178  2836.0  00339B107   ABGENIX INC             2005    4.454545    3.181818    11.000000
  112178  2836.0  00339B107   ABGENIX INC             2006    4.222222    4.000000    13.555556
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    NAN         NAN         NAN 
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    NAN         NAN         NAN         
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    NAN         NAN         NAN 
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    NAN         NAN         NAN         
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    NAN         NAN         NAN     
  178855  2836.0  00383Y102   ABRAXIS BIOSCIENCE INC  2007    4.000000    0.000000    13.544322       
  </code></pre>
  
  <p>If you have some ideas how to implement this in python, please share them with me.</p>
  
  <p>Thank in advance.</p>