Solution to this problem is solving delta y, see bottom of question in ** **
I am writing code for many different equations for linear regression. I have two lists with x and y values. One of my equations creates a new list w. The equation for the list w is (w=1/Δy^2) where y is a list. I have used equations that require lists before but never the change in a list.
I have w = [ 1/(deltay)**2 in zip(x,y)]
But when I print that I get w [False]
. So I dont think I am doing the delta y part right but I have no idea.
Each data point in the list y needs to have an uncertainty of 5%. Right now I am only concerned with w and the uncertainty in y. This w function is needed for something else.
In summary how can I code the equation (w=1/Δy^2) where delta y is a list and w is a list, thanks.
** Ok I have made some progress. I think I know how to solve this now. I have a list of y values. The uncertainty in each y value is 5%. So I need a new list deltay that is the old list y timesed by 0.05. So I am writing this
deltay = [(i*0.05) for i in zip(y)]
But I am getting the error TypeError: can't multiply sequence by non-int of type 'float'**