diff --git a/my_lib/my_funcs.py b/my_lib/my_funcs.py index f1742f4..2bcb386 100644 --- a/my_lib/my_funcs.py +++ b/my_lib/my_funcs.py @@ -1,3 +1,4 @@ + def convertFtoC(unitCol, tempCol): from pyspark.sql.functions import when, col return when(col(unitCol) == "F", (col(tempCol) - 32) * (5/9)).otherwise(col(tempCol)).alias("temp_celcius") diff --git a/temperatures.py b/temperatures.py index b5b8778..3a6013d 100644 --- a/temperatures.py +++ b/temperatures.py @@ -52,3 +52,15 @@ # COMMAND ---------- display(df.select(convertFtoC("unit", "temp"))) + +# COMMAND ---------- + +df.count() + +# COMMAND ---------- + +df.count() + +# COMMAND ---------- + +