I have a dataframe with only two columns in it. I am trying to convert the values of one column to headers and the other column to its values. tried using pivot and all but it is not working.
df_pivot_test = sc.parallelize([('a',1), ('b',1), ('c',2), ('d',2), ('e',10)]).toDF(["id","score"])
id score
a 1
b 1
c 3
d 6
e 10
trying to convert this into
a b c d e
1 1 3 6 10
any thoughts on how we can do this? I don't want to use .toPandas() we can achieve it by converting into pandas dataframe. but we have billions of rows because of which we will run into memory issues.