#!/usr/bin/env python # coding: utf-8 # # df008_createDataSetFromScratch # Create data from scratch with RDataFrame. # # This tutorial shows how to create a dataset from scratch with RDataFrame # # # # # **Author:** Danilo Piparo (CERN) # This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Wednesday, April 17, 2024 at 11:07 AM. # In[1]: import ROOT # We create an empty data frame of 100 entries # In[2]: df = ROOT.RDataFrame(100) # We now fill it with random numbers # In[3]: ROOT.gRandom.SetSeed(1) df_1 = df.Define("rnd", "gRandom->Gaus()") # And we write out the dataset on disk # In[4]: df_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch_py.root")