Spark, Data Science, Tutorial, Machine Learning, Machine Intelligence.
spark.read.format("csv"). option("header", true).load("/<parth to downlaoded file>/<name>.csv").toDF(); data = data .withColumn("rn",row_number() .over(Window.orderBy("year"))).toDF(); data = data.filter(data("rn") > 2).toDF(); var median = data .withColumn("units",data("value").cast(FloatType))