I have a got several list of numbers as output.i need to find the sum of all the corresponding first elements of all the lists(to find the average).
for i in fitsfiles:
hdul = fits.open (i)
flux= hdul[1].data['FLUX']
waves =hdul[1].data['WAVE']
from scipy.interpolate import interp1d
f = interp1d(waves,flux,fill_value='interpolate')
f_int = f(w_int)
intflux = f_int.tolist()
print(sum(intflux[0]))
I interpolated the parent data and the interpolated data is the output intflux. while doing the sum on this float im getting the error "TypeError: 'float' object is not iterable". Please help me how to find the average of all the corresponding elements of the list that comes as output