Suppose that df is a dataframe in Spark. The way to write df into a single CSV file is
df
df.coalesce(1).write.option(\"header\", \"tru
A possible solution could be convert the Spark dataframe to a pandas dataframe and save it as csv:
df.toPandas().to_csv("/")