Reading a file from a private S3 bucket to a pandas dataframe

前端 未结 8 767
猫巷女王i
猫巷女王i 2020-12-08 10:19

I\'m trying to read a CSV file from a private S3 bucket to a pandas dataframe:

df = pandas.read_csv(\'s3://mybucket/file.csv\')

I can read

8条回答
  •  情歌与酒
    2020-12-08 10:38

    Update for pandas 0.22 and up:

    If you have already installed s3fs (pip install s3fs) then you can read the file directly from s3 path, without any imports:

    data = pd.read_csv('s3:/bucket....csv')
    

    stable docs

提交回复
热议问题