我有一个AWS Lambda函数,它查询API并创建数据框,我想将这个文件写入S3存储桶,我正在使用:
import pandas as pd
import s3fs
df.to_csv('s3.console.aws.amazon.com/s3/buckets/info/test.csv', index=False)
我遇到了一个错误:
没有这个文件或目录:'s3.console.aws.amazon.com/s3/buckets/info/test.csv'
但是这个目录存在,因为我正在从那里读取文件。问题出在哪里呢?
我之前是这样读取文件的:
s3_client = boto3.client('s3')
s3_client.download_file('info', 'secrets.json', '/tmp/secrets.json')
我该如何将整个数据框上传到 S3 存储桶?
df.to_csv('s3://info/test.csv', index=False)
。 - Asdfg