Code: Select all
import pickle
import numpy as np
from scipy.interpolate import interp1d
x = np.linspace(0,1,10)
y = np.random.rand(10)
sp = interp1d(x, y)
with open("test.pickle", "wb") as handle:
pickle.dump(sp, handle)
Code: Select all
---------------------------------------------------------------------------
PicklingError Traceback (most recent call last)
in ()
10
11 with open("test.pickle", "wb") as handle:
---> 12 pickle.dump(sp, handle)
PicklingError: Can't pickle : attribute lookup _call_linear on scipy.interpolate.interpolate failed
Mobile version