Dear experts,
I am trying to upload some variables from the python code to the Define. I found this thread: here and tried to reproduce it without any success.
import ROOT
def weight(rf):
x = 0
y = 1
ROOT.gInterpreter.Declare("""
const double x = double(TPython::Exec("x"));
const double y = double(TPython::Exec("y"));
""")
new_rf = rf.Define("weight", "x+y")
return new_rf
rf = ROOT.RDataFrame(...)
weight(rf)
I get the error
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<string> in <module>
NameError: name 'x' is not defined
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<string> in <module>
NameError: name 'y' is not defined
Thank you in advance for help
Lera
Please read tips for efficient and successful posting and posting code
_ROOT Version: 6.20/02
Platform: Not Provided
Compiler: Not Provided