Df 0 0 8_Create Data Set From Scratch

This tutorial shows how to create a dataset from scratch with RDataFrame

Author: Danilo Piparo
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Saturday, January 18, 2020 at 01:32 AM.

We create an empty data frame of 100 entries

In [1]:
ROOT::RDataFrame tdf(100);

We now fill it with random numbers

In [2]:
gRandom->SetSeed(1);
auto tdf_1 = tdf.Define("rnd", []() { return gRandom->Gaus(); });

And we write out the dataset on disk

In [3]:
tdf_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch.root");