Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert dictionary to spark dataframe python

data = [{'student_id': 12, 'name': 'sravan', 'address': 'kakumanu'},
        {'student_id': 14, 'name': 'jyothika', 'address': 'tenali'},
        {'student_id': 11, 'name': 'deepika', 'address': 'repalle'}]
  
# creating a dataframe
dataframe = spark.createDataFrame(data)
 
PREVIOUS NEXT
Tagged: #convert #dictionary #spark #dataframe #python
ADD COMMENT
Topic
Name
1+9 =