Login  Register

Python Saving Interest Rate Curve Objects to File

Posted by TSchulz85 on Sep 26, 2016; 10:48am
URL: http://quantlib.414.s1.nabble.com/Python-Saving-Interest-Rate-Curve-Objects-to-File-tp17751.html

Hi,

I'm very new to QuantLib and Python. Currently I'm bootstrapping e.g. EONIA curves for different dates in the past. These curves I'm saving in Dict. Now I'm trying to save this Dict into a file, so I can access the historical curves without doing the full bootstrapping process (and manually adjusting some of the input datapoints).
I've tried to pickle it and also tried different other methods (HDF5).
e.g.:

import pickle

Eoniafile = open('eoniaDB.obj', 'w')
pickle.dump(EoniaDB, Eoniafile)

This returns the following error:
TypeError: can't pickle SwigPyObject objects

Is there any way to save QuantLib curve objects to a drive or database?

Thanks,
Tobias