Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to write a dataframe to s3 object in python

from io import StringIO # python3; python2: BytesIO 
import boto3

bucket = 'my_bucket_name' # already created on S3
csv_buffer = StringIO()
df.to_csv(csv_buffer)
s3_resource = boto3.resource('s3')
s3_resource.Object(bucket, 'df.csv').put(Body=csv_buffer.getvalue())
Comment

PREVIOUS NEXT
Code Example
Python :: python solve linear equation system 
Python :: python tkinter dynamic toggle button 
Python :: how to numbered jupyter notebook 
Python :: python sort 
Python :: django cleanup 
Python :: urllib.error.HTTPError: HTTP Error 404: Not Found 
Python :: Multidimensional Java Array 
Python :: makemigration django 
Python :: matplotlib histogram frequency labels 
Python :: Drop multiple columns with their index 
Python :: Python script for computing descriptive statistics 
Python :: Aggregate on the entire DataFrame without group 
Python :: read list stored as a string with pandas read csv 
Python :: python slice list 
Python :: flask No application found. Either work inside a view function or push an application context 
Python :: python char at 
Python :: python web framework 
Python :: filter directory in python 
Python :: python os.path.join 
Python :: python list add to start 
Python :: find & replace in csv file 
Python :: first and last name generator python 
Python :: group by pandas 
Python :: matplotlib pie chart order 
Python :: defaultdict python dict inside dict 
Python :: plot matrix as heatmap 
Python :: python google docs api how to get doc index 
Python :: fillna spark dataframe 
Python :: tensorflow neural network 
Python :: updateview 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =