Python Forum
interp2d casting ruled not 'safe'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interp2d casting ruled not 'safe'
#1
Trying to use interp2d in the following context :

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'
I have printed the values concerned in interp2d which are in order 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]]

I know there's a very similar post at numpy array casting ruled not 'safe' but haven't been able to solve the problem ...
Reply


Messages In This Thread
interp2d casting ruled not 'safe' - by sebseb - Jul-05-2018, 09:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Data dtype error according to the rule "safe" AndreasMavro 5 9,206 Feb-27-2020, 10:46 PM
Last Post: Pama
  scipy interp2d doesn't work player1681 4 4,521 Feb-05-2020, 09:50 AM
Last Post: player1681

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020