I have a data frame df like this:
Country Value
US 300
FR 360
IT 500
NL 450
CH 700
CN 233
NF 123
AR 456
BR 129
NG 423
.. ..
.. ..
GR 560
CY 145
ES 890
PR 783
BL 123
and I know that these countries in the df are the top 5 countries for each "experiment type". The experiment type is a list which I have created and it is: my_list = [1, 2, 3, 4, 5, ......,20 ]. Therefore, the first 5 countries belong to experiment 1, the next 5 countries belong to experiment 2,... .....and the last 5 countries belong to experiment 20.
I want to create a column which is going to indicate the countries by experiment, so I want this:
Experiment Country Value
1 US 300
FR 360
IT 500
NL 450
CH 700
2 CN 233
NF 123
AR 456
BR 129
NG 423
.. ..
.. ..
20 GR 560
CY 145
ES 890
PR 783
BL 123
I know that something like this could be done while creating the data frame using groupby function but could you help on which is the best way to do this now, after the initial data frame has been created?