1import pandas as pd
2import boto3
3
4bucket = "yourbucket"
5file_name = "your_file.csv"
6
7s3 = boto3.client('s3')
8# 's3' is a key word. create connection to S3 using default config and all buckets within S3
9
10obj = s3.get_object(Bucket= bucket, Key= file_name)
11# get object and file (key) from bucket
12
13initial_df = pd.read_csv(obj['Body']) # 'Body' is a key word
14