Hi,
Is there a way to pickle ROOT objects in python? I want to do it
for a TF1 function. Is yes, can you please point to a working example?
Thanks,
Shilpi
Hi,
Is there a way to pickle ROOT objects in python? I want to do it
for a TF1 function. Is yes, can you please point to a working example?
Thanks,
Shilpi
Hi,
pickle:
import ROOT
import pickle
h = ROOT.TH1F('myhisto', 'myhisto;x;y', 64, -2, 2)
h.FillRandom('gaus')
pickle.dump( h, open( "histo.p", "wb" ) )
unpickle:
import ROOT
import pickle
h2 = pickle.load( open( "histo.p", "rb" ) )
h2.Draw()
Cheers,
D
Thanks a lot, its working and can write functions as well.
Shilpi
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.