spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jane thorpe <janethor...@aol.com.INVALID>
Subject (float(9)/5)*x + 32) when x = 12.8
Date Sun, 05 Apr 2020 03:33:42 GMT

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
janethorpe1@aol.com

Mime
View raw message