Sorting a DataFrame

Would it be possible to sort a DataFrame using a particular column ?


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


Hi Eddy,

this is presently not possible. We will introduce this capability for cached datasets only, i.e. in memory, for 6.18.
From your expert perspective, how would you see this interface? Would a sorting upon caching enough or you would need to re-sort at any point in time?

mySortedImmutableRdf = myRdf.Cache("", {"sortCol1", "sortCol2"});
// or 
mySortableRdf = myRdf.Cache();
ROOT::RDF::Sort(mySortableRdf, {"sortCol1", "sortCol2"});

Cheers,
Danilo

Hi Danillo,

For my use case only one sort would be done . Just so that I understand the
interface. I would like to sort the rows of a RDataFrame by using “sortCol1” as major index and possible “sortCol2” as minor index.

I would prefer option 2 just to separate aching and sorting.

Best Eddy

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