Convert PySpark DataFrame to Dictionary in Python
www.geeksforgeeks.org › convert-pyspark-dataframeJun 17, 2021 · Converting a data frame having 2 columns to a dictionary, create a data frame with 2 columns naming ‘ Location’ and ‘House_price’ Python3 from pyspark.sql import SparkSession spark = SparkSession.builder.appName ('DF_to_dict').getOrCreate () data = [ ( ('Hyderabad'), 120000), ( ('Delhi'), 124000), ( ('Mumbai'), 344000), ( ('Guntur'), 454000),