I have a simple tree -
>>> import ROOT
>>> f = ROOT.TFile.Open("testbasket.root")
>>> tree = f.Get("t")
>>> tree.Print()
******************************************************************************
*Tree :t : *
*Entries : 5 : Total = 921 bytes File Size = 925 *
* : : Tree compression factor = 1.00 *
******************************************************************************
*Br 0 :intBranch : intBranch/I *
*Entries : 5 : Total Size= 598 bytes File Size = 93 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
With ROOT compiled without experimental PyROOT -
>>> tree.AsMatrix()
array([[1.],
[2.],
[3.],
[4.],
[5.]])
>>> rdf = ROOT.RDataFrame(tree)
>>> rdf.AsNumpy()
{'intBranch': numpy.array([1, 2, 3, 4, 5], dtype=int32)}
With ROOT compiled with experimental PyROOT -
>>> tree.AsMatrix()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'TTree' object has no attribute 'AsMatrix'
>>> rdf = ROOT.RDataFrame(tree)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/reik/test/root/build-dir2/lib/ROOT/_facade.py", line 54, in <lambda>
self.__class__.__getattr__ = lambda self, name: getattr(gbl_namespace, name)
AttributeError: <namespace cppyy.gbl at 0x55a69116ba50> has no attribute 'RDataFrame'. Full details:
type object '' has no attribute 'RDataFrame'
'RDataFrame' is not a known C++ class
'RDataFrame' is not a known C++ template
'RDataFrame' is not a known C++ enum
Can cppyy not handle AsMatrix() and RDataFrame yet?