Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
df000_simple.py File Reference

Namespaces

namespace  df000_simple
 

Detailed Description

View in nbviewer Open in SWAN Simple RDataFrame example in Python.

This tutorial shows a minimal example of RDataFrame. It starts without input data, generates a new column x with random numbers, and finally draws a histogram for x.

import ROOT
# Create a data frame with 100 rows
rdf = ROOT.RDataFrame(100)
# Define a new column `x` that contains random numbers
rdf_x = rdf.Define("x", "gRandom->Rndm()")
# Create a histogram from `x` and draw it
h = rdf_x.Histo1D("x")
h.Draw()
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTree,...
Date
September 2021
Author
Enric Tejedor (CERN)

Definition in file df000_simple.py.