Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
df008_createDataSetFromScratch.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_dataframe
3## \notebook -nodraw
4## Create data from scratch with RDataFrame.
5##
6## This tutorial shows how to create a dataset from scratch with RDataFrame
7##
8## \macro_code
9##
10## \date June 2017
11## \author Danilo Piparo (CERN)
12
13import ROOT
14
15# We create an empty data frame of 100 entries
16df = ROOT.RDataFrame(100)
17
18# We now fill it with random numbers
19ROOT.gRandom.SetSeed(1)
20df_1 = df.Define("rnd", "gRandom->Gaus()")
21
22# And we write out the dataset on disk
23df_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch_py.root")
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...