The problem I'm having is attempting to take the average of my list (derived from y, which is a list of sin values). However, when running the code, I get the error
TypeError: float() argument must be a string or a number, not 'list'
Any help you could offer would be greatly appreciated
for k in range(len(y)-1-r):
list_to_avg = [y[r+k:len(y)-1-r+k]]
b =float(sum(list_to_avg, []))
a =float(len(list_to_avg))
z.append(b/a)