[SciPy-User] scipy.optimize.fixed_point -- TypeError: can't multiply sequence by non-int of type 'float'

Ted To rainexpected@theo...
Wed Sep 5 07:37:44 CDT 2012

On 09/05/2012 08:33 AM, Warren Weckesser wrote:
> I suspect your function is returning a list in some cases.  In the
> multivariate case, the fixed_point function expects the return value of
> your function to be a numpy array.  Modify your code to ensure that br
> always return a numpy array, and see if that fixes the problem.  (One
> option might be to pass in the parameters as arrays instead of lists.
> .e.g fixed_point(br, x0=p, args=(array(q),)), but that depends on how br
> is implemented.)

Many thanks!  That did the trick.

More information about the SciPy-User mailing list