If I have an RDataFrame
where some of the values in some of the columns are NaN, I cannot make a histogram from a column without NaN values:
Exception: TH1D& ROOT::RDF::RResultPtr<TH1D>::operator*() =>
stoll: no conversion (C++ exception of type invalid_argument)
Reproducer follows.
Suppose I have 2 csv files, one with all filled values and one with some empty values:
$ cat temp_good.csv
a,b,c
1,2,3
1,2,3
1,2,3
$ cat temp_bad.csv
a,b,c
1,2,3
1,2,
1,,
I can successfully make a histogram of ‘a’ from temp_good.csv
, but not temp_bad.csv
, even though ‘a’ has all its values defined in both files:
In [1]: import ROOT
In [2]: df_good = ROOT.RDF.MakeCsvDataFrame('temp_good.csv')
In [3]: h_good = df_good.Histo1D('a')
In [4]: h_good.SetFillStyle(3845)
In [5]: df_bad = ROOT.RDF.MakeCsvDataFrame('temp_bad.csv')
In [6]: h_bad = df_bad.Histo1D('a')
In [7]: h_bad.SetFillStyle(3845)
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-7-4aa1c7efd4fb> in <module>()
----> 1 h_bad.SetFillStyle(3845)
Exception: TH1D& ROOT::RDF::RResultPtr<TH1D>::operator*() =>
stoll: no conversion (C++ exception of type invalid_argument)
ROOT Version: master
Platform: macOS
Compiler: Not Provided