Telemetry/Custom analysis with spark: Difference between revisions

name change
(Scheduled Jobs)
(name change)
Line 74: Line 74:
     import numpy as np
     import numpy as np
     #no computation is performed on the following line!
     #no computation is performed on the following line!
     exponentials = numsRdd.map(lambda x : np.float(x) / 10).map(lambda x : (x, np.sin(x)))
     sin_values = numsRdd.map(lambda x : np.float(x) / 10).map(lambda x : (x, np.sin(x)))
     #now the entire computation graph is evaluated
     #now the entire computation graph is evaluated
     exponentials.takeOrdered(5, lambda x : -x[1])
     sin_values.takeOrdered(5, lambda x : -x[1])


For jumping into working with Spark RDD's, we recommend reading the [https://spark.apache.org/docs/latest/programming-guide.html Spark Programming Guide].
For jumping into working with Spark RDD's, we recommend reading the [https://spark.apache.org/docs/latest/programming-guide.html Spark Programming Guide].
29

edits