I have pandas dataframe in the Azure Databricsk. I need to save it as ONE csv file on Azure Data Lake gen2.
I've tried with :
df.write.mode("overwrite").format("com.databricks.spark.csv").option("header","true").csv(dstPath)
and
df.write.format("csv").mode("overwrite").save(dstPath)
but now I have 10 csv files but I need one file and name it.
Thanks in advance.
我找到了一个解决方案:
df.to_csv('/dbfs/mnt/....../df.csv', sep=',', header=True, index=False)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.