Submitting Statements
Describes how to submit statements in HPE Ezmeral Unified Analytics Software.
Prerequisites
- Create an interactive session. See Creating Interactive Sessions.
About this task
Run statements in Python, R, or Scala.
Describes how to submit statements in HPE Ezmeral Unified Analytics Software.
Run statements in Python, R, or Scala.
val NUM_SAMPLES = 10000;
val res = sc.parallelize(1 to NUM_SAMPLES).map { i => val x = Math.random();
val y = Math.random();
if (x*x + y*y < 1) 1 else 0 }.reduce(_ + _);
println("Pi is roughly " + 4.0 * res / NUM_SAMPLES);