The following code worked for me before, but not anymore. I got the error:
AttributeError: 'DataFrame' object has no attribute 'toDF'
if __name__ == "__main__": sc = SparkContext(appName="test") sqlContext = SQLContext(sc) df = sqlContext.read.format('com.databricks.spark.csv').\ options(header='false',delimiter=',',inferSchema='true').load('test') ### rename columns df = df.toDF('a','b','c') ... sc.stop()