I'm trying to do some calculations in python using an excel with several rows and using 3 columns. I'm using the columns 'Band' and 'Antenna_Heigh' and I would like to save these values in the column 'Colors'. My code looks like this but I have an error saying 'list assignment index out of range'.
madrid = pd.read_excel('Madrid.xlsx')
ch = []
d=[]
L = 8.4
for i in range(0, len(madrid)):
ch[i] = 0.8 + (1.1*math.log10(madrid['Band'][i]) - 0.7)*madrid['Antenna_Height'][i] - 1.56*math.log10(madrid['Band'][i])
d[i] = ((L - 69.55 - 26.16*math.log10(madrid['Band'][i]) + 13.82*math.log10(madrid['Antenna_Height'][i]) + ch[i])/(44.9 - 6.55*math.log10(madrid['Antenna_Height'][i])))**10
madrid['Colors'][i] = d[i]