I have a dataframe as follows:
df= year|text|value 2001|text1|10 2001|text2|11 2002|text2|12 2003|text3|56 2005|text8|8 2005|text1|23
Now,I w