Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas read s3 object in jupyter notebook

import boto3
s3_resource = boto3.resource('s3')
bucket = s3_resource.Bucket(name='{bucket_name}')
for file in bucket.objects.all():
    # do what you want with the files
    # for example:
    if 'filter' in file.key:
        print(file.key)
        new_df = pd.read_csv('s3:://{bucket_name}/{}'.format(file.key))
Comment

pandas read s3 object in jupyter notebook

import s3fs

# csv file
df = pd.read_csv('s3://{bucket_name}/{path_to_file}')

# parquet file
df = pd.read_parquet('s3://{bucket_name}/{path_to_file}')
Comment

PREVIOUS NEXT
Code Example
Python :: rich import in python 
Python :: sample k-means clustering 
Python :: pandas funtctioin for i 
Python :: Creating a bag-of-words in scikit-learn 
Python :: HIDING AND ENCRYPTING PASSWORDS IN PYTHON USING MASKPASS MODULE 
Python :: python tk highlightthicknes 
Python :: django startapp in a folder,,while inside that folder 
Python :: how to prefix numbers with zero in python 
Python :: Understand the most appropriate graph to use for your dataset visualization 
Python :: python lambda append to list and return it 
Python :: How to convert Gender to numeric variable 
Python :: egt id of current object django 
Python :: create empty dataframe and concat 
Python :: iterate over batch of dict keys at once python 
Python :: Open a web browser in Python 
Python :: lists as parameters in stats.f_oneway 
Python :: captcha.image install in python 
Python :: poision in chinese 
Python :: run php websevrer with python 
Python :: python time modülü 
Python :: python lxml get parent 
Python :: python output parameter 
Python :: load local data to django 
Python :: discord.py delete own message 
Python :: zeromq pub sub example python 
Python :: Compute the variance of this RDD’s elements 
Python :: get id widget tkinter 
Python :: importando todo o pacote em python 
Python :: pandas save csv list as columns 
Python :: how to get cube root python 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =