Skip to content
Advertisement

Curve_Fit returrns error “Result from function Call is not a proper array of floats”

I am trying to call scipy curve_fit(), with the proper:

  • model function
  • xdata (float numpy 1D Array)
  • ydata (float numpy 1D Array)
  • p (float numpy 1D Array, initial values)

However I am getting the error: ValueError: Object too deep for desired Array

Result from function Call is not a proper array of floats.

the model function I am computing is :

The mathematical expression that optimizes model_f, from which we are trying to find the optimal alpha, gamma.

function model_f computes the mathematical expression appended in the picture.

JavaScript

#——————————————————————————

JavaScript

And I am attaching the data types of the variables mentioned:

Variable types and shapes of the script Can you help me understand what I am doing wrong?

Advertisement

Answer

Compare these 2 calls to curve_fit:

JavaScript

and

JavaScript

Which is closer to your experience?

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement