AttributeError: type object 'RDF' has no attribute 'FromCSV'


ROOT Version: 6.26/04
Platform: lxplus
Compiler: Not Provided


Hi.

I am trying to convert a CSV file to a root file by using RDataFrame.FromCSV. However, it gives an attribute error. My simple code is here:

import ROOT
import os

fileName="/afs/cern.ch/user/u/utok/public/230511_D2_Ch7.csv"

df = ROOT.RDF.FromCSV(fileName)

rootfileName = "230511_D2_Ch7.root"
treeName = "myTree"

df.Snapshot(treeName,rootfileName)

When I run the code, it gives this error;

AttributeError: <namespace cppyy.gbl.ROOT.RDF at 0x508f470> has no attribute ‘FromCSV’. Full details:
type object ‘RDF’ has no attribute ‘FromCSV’
‘ROOT::RDF::FromCSV’ is not a known C++ class
‘FromCSV’ is not a known C++ template
‘FromCSV’ is not a known C++ enum

I checked the forum for discussions about similar issues, but I couldn’t find a related one.

Thanks in advance.

ROOT 6.26 → ROOT::RDF::MakeCsvDataFrame

Recently I tried using the function ROOT::RDF::FromCSV and had the same error, being corrected by the comment above. Later, having a similar error with ROOT::RDF::FromSqlite it was not corrected when changing for the documented version of ROOT::RDF::MakeSqliteDataFrame.

I’m using JupyROOT 6.26/10.

What can be done to fix this issue?
Thank you for your help.