interp2d强制转换不安全

时间:2018-07-05 08:54:27

标签: python arrays types casting

尝试在以下情况下使用interp2d:

    Traceback (most recent call last):
    File "<console>", line 1, in <module>
    File "C:\Users\user\Desktop\Stage\Python\stability.py", line 495, in stable
    p_W.append(W_L10(V,U1[i],TU1[i],OOD,soil,Su,gamma_soil))
    File "C:\Users\user\Desktop\Stage\Python\stability.py", line 312, in W_L10
    L_N3=interp2d(mGc,mM,Matrix)(Gc,M)
    File "c:\users\user\miniconda3\lib\site-packages\scipy\interpolate\interpolate.py", line 307, in __call__
    z = fitpack.bisplev(x, y, self.tck, dx, dy)
    File "c:\users\user\miniconda3\lib\site-packages\scipy\interpolate\_fitpack_impl.py", line 1047, in bisplev
    z, ier = _fitpack._bispev(tx, ty, c, kx, ky, x, y, dx, dy)

    TypeError: Cannot cast array data from dtype('O') to dtype('float64') according to the rule 'safe'

我已经按顺序打印了interp2d中涉及的值 Gc,M,mGc,mM,Matrix: 0.7258476098065036

1.05986517918965e-11

[0.556,1.11]

[0.0,0.2]

[[5.69828841092783,8.43276280371185],[5.69828841092783,8.43276280371185]

我知道numpy array casting ruled not 'safe'上有一个非常相似的帖子,但是还不能解决问题...

0 个答案:

没有答案