read csv boto3

Solutions on MaxInterview for read csv boto3 by the best coders in the world

showing results for - "read csv boto3"
Theo
11 Aug 2018
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