ROOT
v6-26
Reference Guide
Loading...
Searching...
No Matches
df008_createDataSetFromScratch.C
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
13
void
df008_createDataSetFromScratch
()
14
{
15
// We create an empty data frame of 100 entries
16
ROOT::RDataFrame
df(100);
17
18
// We now fill it with random numbers
19
gRandom
->
SetSeed
(1);
20
auto
df_1 = df.Define(
"rnd"
, []() {
return
gRandom
->
Gaus
(); });
21
22
// And we write out the dataset on disk
23
df_1.Snapshot(
"randomNumbers"
,
"df008_createDataSetFromScratch.root"
);
24
}
gRandom
R__EXTERN TRandom * gRandom
Definition
TRandom.h:62
ROOT::RDataFrame
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTree,...
Definition
RDataFrame.hxx:50
TRandom::Gaus
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition
TRandom.cxx:274
TRandom::SetSeed
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition
TRandom.cxx:608
df008_createDataSetFromScratch
Definition
df008_createDataSetFromScratch.py:1
tutorials
dataframe
df008_createDataSetFromScratch.C
ROOT v6-26 - Reference Guide Generated on Mon Sep 11 2023 21:03:01 (GVA Time) using Doxygen 1.9.8