Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

column to list pyspark

# convert student Name to list using
# flatMap
print(dataframe.select('student Name').
      rdd.flatMap(lambda x: x).collect())
 
# convert student ID to list using
# flatMap
print(dataframe.select('student ID').
      rdd.flatMap(lambda x: x).collect())
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #column #list #pyspark
ADD COMMENT
Topic
Name
2+1 =