I have a large df where I would like to assign the values of variables to the 'frequency' column based on the values of the 'period' column and the 'tier' column.
This is a simplified version of the dataframe:
freq1= 1
freq2= 2
freq2= 2
freq2= 4
freq2= 5
freq2= 6
freq2= 7
freq2= 4
what I would like to do, is apply the value of the variables to the frequency column. For example, if df.period == 1 & df.tier == 1
then df['frequency'] = freq1
Please do not pay attention to the values of each variable, this is a crude representation of the real problem. The principle however, remains the same.