Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert python list to pyspark column

from pyspark.sql import Row
    li=[1,2,3,4]
    rdd1 = sc.parallelize(li)
    row_rdd = rdd1.map(lambda x: Row(x))
    df=sqlContext.createDataFrame(row_rdd,['numbers']).show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #python #list #pyspark #column
ADD COMMENT
Topic
Name
3+2 =