Elina Gilbert
Elina Gilbert

Reputation: 155

Error in NumPy: 'numpy.ndarray' object is not callable

I was working on a cournot problem, but was getting this error:

TypeError: 'numpy.ndarray' object is not callable

Can anyone help me locate the error I am getting?

Upvotes: 1

Views: 1154

Answers (1)

sascha
sascha

Reputation: 33532

Your function resid returns an numpy-array at call-time.

Your need to give broyden a function, but gave it a called function, so it's not a function anymore, but was already evaluated to some array. This results in broyden1 to call the resulting numpy-array.

This is not equal:

c1= broyden1(resid(c,p_node,alpha,eta,phi), c)
c1= broyden1(resid, c)

I'm ignoring possible consequences here.

Upvotes: 1

Related Questions