Save Dataframe to csv directly to s3 Python

前端 未结 10 921
独厮守ぢ
独厮守ぢ 2020-11-28 02:02

I have a pandas DataFrame that I want to upload to a new CSV file. The problem is that I don\'t want to save the file locally before transferring it to s3. Is there any meth

10条回答
  •  遥遥无期
    2020-11-28 02:40

    You can also use the AWS Data Wrangler:

    import awswrangler as wr
        
    wr.s3.to_csv(
        df=df,
        path="s3://...",
    )
    

    Note that it will handle multipart upload for you to make the upload faster.

提交回复
热议问题