# RDataFrame and TMVA in pyroot

**URL:** <https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930>\
**Category:** Newbie\
**Tags:** python, rdataframe, tmva\
**Created:** [April 16, 2020, 7:54pm UTC](https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930 "2020-04-16T19:54:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![swunsch](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/50afbb/32.png) [@swunsch](https://root-forum.cern.ch/u/swunsch)\
**Post date:** [April 17, 2020, 8:52am UTC](https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930/3 "2020-04-17T08:52:25Z")

</div>

Hi!

Happy to see that you found the new feature 🙂 Though the disclaimer comes first: You are on experimental terrain!

Now the solution to your issue. Unfortunately, PyROOT (so the Python bindings for C++) are not (yet) able to parse the template we use in C++ (see [here](https://root.cern/doc/master/namespaceTMVA_1_1Experimental.html#a1ff0a536f0ce7697e41b15d0b4197321)). However, you can play a little trick to make it still working in Python! Because PyROOT sees all objects created by the C++ interpreter cling, you can just make a call in C++. Please note that the snipplet assumes that you have run the tutorial `tmva103_RReader.C` before:

```python
import ROOT

ROOT.gInterpreter.ProcessLine('''
TMVA::Experimental::RReader model("tmva003_BDT/weights/tmva003_BDT.weights.xml");
computeModel = TMVA::Experimental::Compute<4, float>(model);
''')

df = ROOT.RDataFrame('TreeS', 'http://root.cern.ch/files/tmva_class_example.root')
df = df.Define('y', ROOT.computeModel, ROOT.model.GetVariableNames())
h = df.Histo1D('y')

h.Draw()

```

Best  
Stefan

---

_[View the full topic](https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930)._
