This recipe shows how to perform complex operations such as computing difference on a column in Pandas DataFrames as well as Spark DataFrames.
To step through this recipe, you will need a running Spark cluster either in pseudo distributed mode or in one of the distributed modes, that is, standalone, YARN, or Mesos. Also, have Python and IPython installed on the Linux machine, that is, Ubuntu 14.04.
ipython console -profile=pyspark:
In : from pyspark import SparkConf, SparkContext, SQLContext In : import pandas as pd In : sqlcontext = SQLContext(sc)
diffon a column in Pandas:
In : df = sqlCtx.createDataFrame([(1, 4), (1, 5), (2, 6), (2, 6), (3, 0)], ["A", "B"]) ...