Logo ROOT   6.14/05
Reference Guide
df008_createDataSetFromScratch.py
Go to the documentation of this file.
1 ## \file
2 ## \ingroup tutorial_dataframe
3 ## \notebook -nodraw
4 ## This tutorial shows how to create a dataset from scratch with RDataFrame
5 ## \macro_code
6 ##
7 ## \date June 2017
8 ## \author Danilo Piparo
9 
10 import ROOT
11 
12 # We create an empty data frame of 100 entries
13 tdf = ROOT.ROOT.RDataFrame(100)
14 
15 # We now fill it with random numbers
16 ROOT.gRandom.SetSeed(1)
17 tdf_1 = tdf.Define("rnd", "gRandom->Gaus()")
18 
19 # And we write out the dataset on disk
20 tdf_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch.root")
21