Load S3 Data into AWS SageMaker Notebook

前端 未结 7 1332
生来不讨喜
生来不讨喜 2020-12-01 07:39

I\'ve just started to experiment with AWS SageMaker and would like to load data from an S3 bucket into a pandas dataframe in my SageMaker python jupyter notebook for analysi

7条回答
  •  执笔经年
    2020-12-01 08:15

    You could also access your bucket as your file system using s3fs

    import s3fs
    fs = s3fs.S3FileSystem()
    
    # To List 5 files in your accessible bucket
    fs.ls('s3://bucket-name/data/')[:5]
    
    # open it directly
    with fs.open(f's3://bucket-name/data/image.png') as f:
        display(Image.open(f))
    

提交回复
热议问题