Home | News | Documentation | Download

Check for empty RDataFrame

Hello all,

I am getting the following errors when I am trying to call a Histo2D:
hSRTT21 = Pass.Histo2D((“Pass_21”,“Pass_21”,9 ,40 ,220 ,13 ,700 ,2000),‘mh’,‘mhh_21’)

gets:

File “hhAll_preselection.py”, line 196, in
hSRTT21 = Pass.Histo2D((“Pass_21”,“Pass_21”,9 ,40 ,220 ,13 ,700 ,2000),‘mh’,‘mhh_21’)
TypeError: can not resolve method template call for ‘Histo2D’

where Pass is a rdataframe that is returned after some cuts. I think it might be possible that this dataframe is empty so I was wondering how I might be able to check it. Also, would an empty dataframe be a possible problem here since the columns I am trying to plot wouldn’t exist?

Thanks,

Derek


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Just for someone who finds this, the problem was actually an issue with the definition of the column for mhh_21. It didn’t define properly so the filter returned a null pointer.

1 Like