I tried to read in a csv file using: auto tdf = ROOT::RDF::MakeCsvDataFrame("data.csv"); but it did not work. I looked around and it seems that RDataFrame cannot exponential formated data from a csv file, i.e. 1.3e6, 1.4e4,1e4 is read in as three strings instead of three doubles.
Is that right and is someone working on this issue?
Thanks a lot!
ROOT Version: 6.14.04 Platform: Linux Compiler: gcc
while we implement and backport the fix, you can convert the csv to an equivalent one which will be processed by the csv source.
The python snippet to do this is the following:
import sys
lines = open(sys.argv[1]).readlines()
print lines[0],
for line in lines[1:]:
sci_numbers = line[:-1].split(',')
numbers = map(lambda x : "%.8f" %x, map(float, sci_numbers))
print ",".join(numbers)
the invocation is
python convert.py myoriginal.csv >& converted.csv
The csv you pasted in the previous post contains perhaps a typo, i.e. 0.9e.5: could it be 0.9e-5?
Just to add on the complete answer of Danilo, I confirm that we currently do not support exponent syntax for the double type. For the record these are the current regexes: