I read online that you can save the contents of a dataframe to a CSV file, in a data lake, using a couple different methods. My dataframe is just fine, but I can't seem to save it to a CSV file. I am happy to put this CSV in the lake, or on my desktop. Either is totally fine.
Attempt 1:
df.write.csv("/data/home/csv")
Attempt 2:
df.coalesce(1).write.csv("/data/home/sample.csv")
Neither options work for me. With both, I am getting an error message that reads
AttributeError: 'DataFrame' object has no attribute 'write'
Has anyone here actually gotten this to work? I am working in a Databricks environment. TIA.