Create data from scratch with RDataFrame.
This tutorial shows how to create a dataset from scratch with RDataFrame
Author: Danilo Piparo (CERN)
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Monday, March 27, 2023 at 09:45 AM.
import ROOT
Welcome to JupyROOT 6.29/01
We create an empty data frame of 100 entries
df = ROOT.RDataFrame(100)
We now fill it with random numbers
ROOT.gRandom.SetSeed(1)
df_1 = df.Define("rnd", "gRandom->Gaus()")
And we write out the dataset on disk
df_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch_py.root")
<cppyy.gbl.ROOT.RDF.RResultPtr<ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void> > object at 0xc14a590>