Logo ROOT   6.12/07
Reference Guide
tdf008_createDataSetFromScratch.py
Go to the documentation of this file.
1 ## \file
2 ## \ingroup tutorial_tdataframe
3 ## \notebook -nodraw
4 ## This tutorial shows how to create a dataset from scratch with TDataFrame
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.Experimental.TDataFrame(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", "tdf008_createDataSetFromScratch.root")
21