How to read a list of parquet files from S3 as a pandas dataframe using pyarrow?

后端 未结 7 1727
小蘑菇
小蘑菇 2020-12-04 09:15

I have a hacky way of achieving this using boto3 (1.4.4), pyarrow (0.4.1) and pandas (0.20.3).

First, I can read a single parq

7条回答
  •  醉梦人生
    2020-12-04 09:38

    You can use s3fs from dask which implements a filesystem interface for s3. Then you can use the filesystem argument of ParquetDataset like so:

    import s3fs
    s3 = s3fs.S3FileSystem()
    dataset = pq.ParquetDataset('s3n://dsn/to/my/bucket', filesystem=s3)
    

提交回复
热议问题