22RDataFrame = ROOT.RDF.Experimental.Distributed.Spark.RDataFrame
50sparkconf = pyspark.SparkConf().setAll(
51 {
"spark.app.name":
"distrdf001_spark_connection",
52 "spark.master":
"local[4]", }.items())
54sparkcontext = pyspark.SparkContext(conf=sparkconf)
57df = RDataFrame(1000, sparkcontext=sparkcontext)
60ROOT.gRandom.SetSeed(1)
61df_1 = df.Define(
"gaus",
"gRandom->Gaus(10, 1)").Define(
"exponential",
"gRandom->Exp(10)")
64h_gaus = df_1.Histo1D((
"gaus",
"Normal distribution", 50, 0, 30),
"gaus")
65h_exp = df_1.Histo1D((
"exponential",
"Exponential distribution", 50, 0, 30),
"exponential")
68c = ROOT.TCanvas(
"distrdf001",
"distrdf001", 800, 400)
76c.SaveAs(
"distrdf001_spark_connection.png")
77print(
"Saved figure to distrdf001_spark_connection.png")