Skip to content
Prev Previous commit
Next Next commit
add spark sqlcontext for toDF
  • Loading branch information
yinxusen committed Jul 4, 2016
commit 9e102a6cbfa02b8c06f398df2dbba99305669c5d
2 changes: 2 additions & 0 deletions examples/src/main/python/mllib/datatypes_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import print_function

from pyspark import SparkContext
from pyspark.sql import SQLContext


def __local_vector_example():
Expand Down Expand Up @@ -95,6 +96,7 @@ def __row_matrix_example():

def __indexed_row_matrix_example():
sc = SparkContext.getOrCreate()
sqlContext = SQLContext.getOrCreate(sc)

# $example on:indexed_row_matrix$
from pyspark.mllib.linalg.distributed import IndexedRow, IndexedRowMatrix
Expand Down