I'm looking for a way to save a dataframe into a csv file without specifying headers.
I tried the code below but it did not work.
ratingsDF.coalesce(1).write.option("header", "false")\
.csv("csv_file_without_headers.csv")
For the dataframe below:
+---------+-----+
| x| y| z|
+----+----+-----+
| 0| a| 5|
| 1| b| 12|
| 2| c| 7|
| 3| d| 27|
| 4| e| 149|
| 5| f| 19|
+---------+-----+
The expected result of csv:
O,a,5
1,b,12
2,c,7
3,d,27
4,e,149
5,f,19