I have a dataframe like this:
I want to take the mean of WFR between 2009-2015 for each NAME and put it for all the years of each NAME. any idea? Thanks
How to setup
data = {'NAME': ['A', 'B', 'B', 'B', 'B', 'C', 'C', 'D', 'D', 'D'],
'YEAR': [2017, 2009, 2011, 2017, 2018, 2010, 2018, 2014, 2015, 2016],
'WFR': [20, 50, 80, 60, 90, 10, 30, 40, 55, 45]}
df = pd.DataFrame(data)
