I’m having a problem to create a TGraph from pandas dataframe.
This is the part of the code, where I read the data with pandas, I convert the 2 columns in array in order to pass them to the TGraph:
import pandas as pd
The error that I got is:
Error in <TGaxis::PaintAxis>: length of axis is 0
I check the data reading and it is ok
thanks in advance
not sure what the cause could be. Anyway, perhaps the best solution would be to use RDataFrame directly in ROOT:
MakeCsvDataFrame = ROOT.ROOT.RDF.MakeCsvDataFrame
# here it depends if you have headers for your columns or not
df = MakeCsvDataFrame("myTextInput", hasHeaders, "\t")
# again here we assume you do not have headers
g = df.Graph("Col0", "Col1")
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.