Beizen Scipy interp1d SplinePython

Python-Programme
Anonymous
 Beizen Scipy interp1d Spline

Post by Anonymous »

Ich frage mich, ob es eine einfache Möglichkeit gibt, ein interp1d-Objekt in Scipy auszuwählen. Der naive Ansatz scheint nicht zu funktionieren.

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)
Dies löst den folgenden PicklingError aus:

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

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post