PLATFORM
zeppelin 0.9  
SPARK_HOME = spark-3.0.0-preview2-bin-hadoop2.7

%spark.ipyspark

# work around
sc.setJobGroup("a","b")
tempc = sc.parallelize([12.8])
tempf = tempc.map(lambda x: (float(9)/5)*x + 32)
tempf.collect()

OUTPUT 
[55.040000000000006] 
 
%spark.ipyspark

# work around
sc.setJobGroup("a","b")
tempc = sc.parallelize([38.4,19.2,13.8,9.6])
tempf = tempc.map(lambda x: (float(9)/5)*x + 32)
tempf.collect()
OUTPUT :
[101.12, 66.56, 56.84, 49.28]
calculator  result =  55.04 

Is the answer correct  when x =  12.8  ?

 
jane thorpe
janethor...@aol.com

Reply via email to