how to convert list into string in python

Viewed 40

I'm getting output as list value as shown below [Row(column1='a,b,c,d')]

how to convert this to string value needed output: 'a,b,c,d'

how to achieve this using python/pyspark?

1 Answers

What you're referring to is just a list of PySpark Row objects, and in order to get values out of those objects, you just need to loop through it

print([r['column1'] for r in df.collect()])
Related