Exponential form in csv to dataframe


I’m trying to convert a .csv file containing numbers in exponential syntax to an RDataFrame using the RDF::MakeCsvDataFrame() function.

I found this topic on the matter CSV to RDataFrame saying that exponential syntax is not supported by RDataFrame and suggesting to modify the input csv file.

This is not really optimal in my case as I have tens of thousands of csv files to process.
Did anything changed in the last year/is there any plan to support exponential syntax/is there a different suggested way to approach the problem?

Thanks for the help,

Hi Gabriele,
welcome to the ROOT forum!

Support for scientific notation has recently been added to MakeCsvDataFrame by @etejedor. I think it’s only available in ROOT master though (i.e. in nightly builds, that you can get as binaries or from CVMFS, but are not guaranteed to be 100% stable). The feature will also be available in the next ROOT release (beginning of next year).

It’s a bit borderline between “new feature” and “bugfix” so I’m not sure whether the support for scientific notation could/should be backported. @etejedor and @Axel can probably comment further.


EDIT: i was mistaken, it’s not available in master yet, it’s a PR: https://github.com/root-project/root/pull/4441 but it’s coming to master soon :slight_smile:

@etejedor In the new regex, please modify [eE] into [eEdDqQ] (single-, double-, quad- precision).

Hi @eguiraud, thanks for the answer. This is a great news! I’ll have a look at the PR.

Thanks again!

Thanks @Wile_E_Coyote, I have added your suggestion as a comment to the PR.

It’s you call, @eguiraud and @etejedor , whether this should count as a bug fix - you know the risks :wink: I’m okay with either decision.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.