This tutorial shows how the content of an RDataFrame can be converted to an RTensor object.
void tmva002_RDataFrameAsTensor()
{
auto df2 = df.Define("x", "1.f*rdfentry_").Define("y", "-1.f*rdfentry_");
auto x = AsTensor<float>(df2);
std::cout <<
"RTensor from an RDataFrame:\n" <<
x <<
"\n\n";
auto x2 = AsTensor<float>(df2, {
"x"}, MemoryLayout::ColumnMajor);
std::cout <<
"RTensor from a single column of the RDataFrame:\n" <<
x2 <<
"\n\n";
}
Option_t Option_t TPoint TPoint const char x2
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
RTensor from an RDataFrame:
{ { 0, -0 } { 1, -1 } { 2, -2 } { 3, -3 } { 4, -4 } }
RTensor from a single column of the RDataFrame:
{ { 0 } { 1 } { 2 } { 3 } { 4 } }
- Date
- December 2018
- Author
- Stefan Wunsch
Definition in file tmva002_RDataFrameAsTensor.C.