I want to repeat a df for each year in a list.
Every time the df repeats, it should also add the year corresponding to the iteration, in a new column called 'year'.
I have:
>>> ls = ['2019','2018','2017','2016']
>>> df = pd.DataFrame(['a','b'])
>>> df
0
0 a
1 b
I want:
>>> df
0 year
0 a '2019'
1 b '2019'
2 a '2018'
3 b '2018'
4 a '2017'
5 b '2017'
6 a '2016'
7 b '2016'