I am reading a file from s3 in pandas.
aws_credentials = {
"key": "xxxx",
"secret": "xxxx"
}
# Read data from S3
df_aln = pd.read_csv("s3://dir/ABC/fname_0521.csv", storage_options=aws_credentials, encoding='latin-1')
However, I have several files with same shape and similar naming convention fname_mmyy
. How do I read all the files that match the naming pattern and combine them into one pandas DataFrame?
I'd prefer to not write pd.read_csv
to read each file separately.