RDataFrame Acessing ForEach in pyroot

Hi,
currently Foreach is not supported in PyROOT as far as I know. The relevant issue is https://sft.its.cern.ch/jira/browse/ROOT-10246, you can comment there to let us know that it’s an important feature for you.

What’s happening in df.Foreach(col,ROOT.print_rvec[float](mu_col[0]) ) is that you are calling print_rvec right there and then, passing mu_col[0] as argument, and that’s why you see it printing. Then the result of that call to print_rvec is passed to df.Foreach, triggering the error you see.

Cheers,
Enrico