I am reading multiple csv files from a folder using the following code
import pandas as pd
import s3fs
s3 = s3fs.S3FileSystem(anon=False)
bucket='<my_s3_bucket_name>'
object = '<my-file-path>/*.csv'
path= s3.glob('s3://{}/{}'.format(bucket, object))
path
When I display the list of csv files, I get all the csv files in the folder but the path comes without the s3 prefix and when I try to read the csv file, it gives me FileNotFoundError: [Errno 2] No such file or directory:
Any help will be really appreciated
source https://stackoverflow.com/questions/75538393/correct-path-not-being-displayed-while-reading-a-file-using-s3-glob
Comments
Post a Comment