Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas read s3 object in jupyter notebook

import boto3
s3_resource = boto3.resource('s3')
bucket = s3_resource.Bucket(name='{bucket_name}')
for file in bucket.objects.all():
    # do what you want with the files
    # for example:
    if 'filter' in file.key:
        print(file.key)
        new_df = pd.read_csv('s3:://{bucket_name}/{}'.format(file.key))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #read #object #jupyter #notebook
ADD COMMENT
Topic
Name
9+9 =