Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches

Detailed Description

View in nbviewer Open in SWAN
Use the Display action to inspect entry values.

void df024_Display()
{
// Setting up a Dataframe with some data
unsigned long long y = 1;
int x = 1;
double w = 1;
double z = 1;
auto d = df.Define("y", [&y]() { return y *= 100; }) // A column with ulongs
.Define("x",
[&x]() {
return std::vector<int>({x++, x++, x++, x++});
}) // A column with four-elements collection
.Define("w", [&w]() { return w *= 1.8; }) // A column with doubles
.Define("z", [&z]() {
z *= 1.1;
return std::vector<std::vector<double>>({{z, ++z}, {z, ++z}, {z, ++z}});
}); // A column of matrices
// Preparing the RResultPtr<RDisplay> object with all columns and default number of entries
auto d1 = d.Display("");
// Preparing the RResultPtr<RDisplay> object with two columns and default number of entries
auto d2 = d.Display({"x", "y"});
// Printing the short representations, the event loop will run
std::cout << "The following is the representation of all columns with the default nr of entries" << std::endl;
d1->Print();
std::cout << "\n\nThe following is the representation of two columns with the default nr of entries" << std::endl;
d2->Print();
}
#define d(i)
Definition RSha256.hxx:102
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
The following is the representation of all columns with the default nr of entries
+-----+-----------+----+-------------+--------------------------+
| Row | w | x | y | z |
+-----+-----------+----+-------------+--------------------------+
| 0 | 1.800000 | 1 | 100 | { 1.1000000, 2.1000000 } |
| | | 2 | | { 2.1000000, 3.1000000 } |
| | | 3 | | { 3.1000000, 4.1000000 } |
| | | 4 | | |
+-----+-----------+----+-------------+--------------------------+
| 1 | 3.240000 | 5 | 10000 | { 4.5100000, 5.5100000 } |
| | | 6 | | { 5.5100000, 6.5100000 } |
| | | 7 | | { 6.5100000, 7.5100000 } |
| | | 8 | | |
+-----+-----------+----+-------------+--------------------------+
| 2 | 5.832000 | 9 | 1000000 | { 8.2610000, 9.2610000 } |
| | | 10 | | { 9.2610000, 10.261000 } |
| | | 11 | | { 10.261000, 11.261000 } |
| | | 12 | | |
+-----+-----------+----+-------------+--------------------------+
| 3 | 10.497600 | 13 | 100000000 | { 12.387100, 13.387100 } |
| | | 14 | | { 13.387100, 14.387100 } |
| | | 15 | | { 14.387100, 15.387100 } |
| | | 16 | | |
+-----+-----------+----+-------------+--------------------------+
| 4 | 18.895680 | 17 | 10000000000 | { 16.925810, 17.925810 } |
| | | 18 | | { 17.925810, 18.925810 } |
| | | 19 | | { 18.925810, 19.925810 } |
| | | 20 | | |
+-----+-----------+----+-------------+--------------------------+
The following is the representation of two columns with the default nr of entries
+-----+----+-------------+
| Row | x | y |
+-----+----+-------------+
| 0 | 1 | 100 |
| | 2 | |
| | 3 | |
| | 4 | |
+-----+----+-------------+
| 1 | 5 | 10000 |
| | 6 | |
| | 7 | |
| | 8 | |
+-----+----+-------------+
| 2 | 9 | 1000000 |
| | 10 | |
| | 11 | |
| | 12 | |
+-----+----+-------------+
| 3 | 13 | 100000000 |
| | 14 | |
| | 15 | |
| | 16 | |
+-----+----+-------------+
| 4 | 17 | 10000000000 |
| | 18 | |
| | 19 | |
| | 20 | |
+-----+----+-------------+
Date
August 2018
Authors
Enrico Guiraud, Danilo Piparo, Enric Tejedor Saavedra (CERN), Massimo Tumolo (Politecnico di Torino)

Definition in file df024_Display.C.