I tried to make an estimate of a population with the newtinterp function above but it somehow does not work. But its not working

Viewed 19

I tried to make an estimate of a population with the newtinterp function above but it somehow does not work. Can somebody please tell me what is wrong with my code?

enter image description here

1 Answers

f is not function but result from newtinterp(x,y,z)

You should run directly

for x in range(1991, 2017):
    print(..., newtinterp(x,y,z))

Or you could use lambda to create partial function

f = lambda year: newtinterp(year,y,z)

for x in range(1991, 2017):
    print(..., f(x))

Or you could create normal function

def f(year):
    return newtinterp(year,y,z)
Related