Traceback (most recent call last):
File “df_numpy.py”, line 12, in
npy = df.AsNumpy()
AttributeError: ‘RInterfaceROOT::Detail::RDF::RLoopManager,void’ object has no attribute ‘AsNumpy’
Hi @tahuang1991,
the docs you linked to are for ROOT master. You should see exploring the reference guides for different ROOT versions that the AsNumpy tutorial is not present in v6.16, because the feature was introduced in ROOT v6.18.
Now I upgraded the Mac OS to 10.15.5 and ROOT to v6.20.04. The df_numpy() is working fine for me. However, when I was trying the scripts for RDataFrame under tutorial, i ran into trouble again.
python tmva100_DataPreparation.py
>>> Extract the training and testing events for signal from the SMHiggsToZZTo4L.root dataset.
Traceback (most recent call last):
File "tmva100_DataPreparation.py", line 60, in <module>
.Snapshot("Events", "train_" + label + ".root", columns)
TypeError: can not resolve method template call for 'Snapshot'
I am not sure why tmva100_DataPreparation.py is not working. I also checked out the ntuples used in script to my local directory.
Do you know which PyROOT version you use? You can most easily check by trying to create a std::vector in python via ROOT.std.vector['float'](). The “old” PyROOT should complain and say AttributeError: Template instance has no attribute '__getitem__'. In the meanwhile I try to reproduce the problem!