This recipe shows how to implement co-variance using Pandas DataFrames over Spark.
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 : seq=pd.Series([1,2,3,4,4,3,2,1], ['2006','2007','2008','2009','2010','2011','2012','2013']) In : seq2 = pd.Series([3,4,3,4,5,4,3,2], ...