I have a pyspark dataframe with two columns:
[Row(zip_code='58542', dma='MIN'),
Row(zip_code='58701', dma='MIN'),
Row(zip_code='57632', dma='MIN'),
Row(zip_code='58734', dma='MIN')]
How can I make a key:value pair out of the data inside the columns?
e.g.:
{
"58542":"MIN",
"58701:"MIN",
etc..
}
I would like to avoid using collect for performance reasons. I've tried a few things but can't seem to get just the values.