ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
df000_simple.py
Go to the documentation of this file.
1
## \file
2
## \ingroup tutorial_dataframe
3
## \notebook -draw
4
## Simple RDataFrame example in Python.
5
##
6
## This tutorial shows a minimal example of RDataFrame. It starts without input
7
## data, generates a new column `x` with random numbers, and finally draws
8
## a histogram for `x`.
9
##
10
## \macro_code
11
## \macro_output
12
##
13
## \date September 2021
14
## \author Enric Tejedor (CERN)
15
16
import
ROOT
17
18
# Create a data frame with 100 rows
19
rdf =
ROOT.RDataFrame
(100)
20
21
# Define a new column `x` that contains random numbers
22
rdf_x = rdf.Define(
"x"
,
"gRandom->Rndm()"
)
23
24
# Create a histogram from `x` and draw it
25
h = rdf_x.Histo1D(
"x"
)
26
h.Draw()
ROOT::RDataFrame
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Definition
RDataFrame.hxx:41
tutorials
dataframe
df000_simple.py
ROOT v6-32 - Reference Guide Generated on Fri Nov 1 2024 15:09:38 (GVA Time) using Doxygen 1.9.8