scipy curve_fit error: Result from function call is not a proper array of floats

后端 未结 1 1191
误落风尘
误落风尘 2020-12-21 14:35

I have an [x,y] dataset and I would like to fit a function to it. This are x and y

parang = np.array([  61.1725  ,   62.140625,   62.93275 ,   63.701625,   6         


        
相关标签:
1条回答
  • 2020-12-21 14:58

    Since stndqu is the result of a call to sympy.solve, it is a symbolic object still. The numbers that you see when printing qval from within your function are probably sympy floats (and thus generic objects to numpy). You should convert stndqu into a numpy array before using it with scipy.curve_fit:

    stndqun = numpy.array([sympy.N(i) for i in stndqu])
    
    0 讨论(0)
提交回复
热议问题