'TH1D' object has no attribute 'PYROOT__div__'

Dear experts,

I was trying to simply divide two TH1D in a bigger expression using directly / operator.
I got
‘TH1D’ object has no attribute ‘PYROOT__div__’
but all the other operators work fine.
Is this expected?
In C/C++ it works.

Cheers,
Simone


ROOT Version: 6.20/06
Python Version: 2.7.16


Hello,

With ROOT 6.22 we released a new PyROOT where this works.

6.20/06 (the error you see):

>>> h1 = ROOT.TH1D("","",10,1,100)
>>> h2 = ROOT.TH1D("","",10,1,100)
>>> h1/h2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'TH1D' object has no attribute 'PYROOT__div__'

6.22/06:

>>> h1 = ROOT.TH1D("","",10,1,100)
>>> h2 = ROOT.TH1D("","",10,1,100)
>>> h1/h2
<cppyy.gbl.TH1D object at 0x65b2bc0>

Cheers,
Enric

1 Like

Hello,

Sorry my bad, I actually checked only 6.18 and 6.20.

Thanks!

S

No problem! Let us know if you find any other issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.