Selecting values fromt he same df but for different years : I have a data frame of some features and corresponding years. Each value of the feature is listed for different years.  I need to compare the values of a specific year with that 7 years earlier. So basically I need to define a function that will generate two columns one will give me the value of the feature from the table for a specific year and the other one for the same feature but 7 years earlier. How can I do that?  
feature   year
value1     2001
value1     2008  
vlaue2     1996 etc  
e.g. I want to compare value1(2008) with value1(2008 - 7) etc. 
there should also be some conditional statements as year 2000 can't be compared with (2000-7 =1993) because there is no value for the feature for year (1993) for example. 
Thanks a lot. 