Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas dataframe to parquet s3

import awswrangler as wr
wr.pandas.to_parquet(
    dataframe=df,
    path="s3://my-bucket/key/my-file.parquet"
)
Comment

read parquet from s3 and convert to dataframe

import pyarrow.parquet as pq
import s3fs

dataset = pq.ParquetDataset('s3://<s3_path_to_folder_or_file>', 
filesystem=s3fs.S3FileSystem(), filters=[('colA', '=', 'some_value'), ('colB', '>=', some_number)])
table = dataset.read()
df = table.to_pandas()
Comment

pandas read parquet from s3

s3_url = 's3://bucket/folder/bucket.parquet.gzip'
df.to_parquet(s3_url, compression='gzip')
Comment

df to parquet s3

import awswrangler as wr
wr.s3.to_parquet(
    dataframe=df,
    path="s3://my-bucket/key/my-file.parquet"
)
Comment

PREVIOUS NEXT
Code Example
Python :: multiple variables in for loop python 
Python :: how to check type inside a list in python 
Python :: enable debug mode flask 
Python :: how to make a venv python 
Python :: random string generate python of 2.7 
Python :: download image from url python 3 
Python :: how to make a list string in python 
Python :: python file.write is not writing whole line 
Python :: sort list alphabetically python 
Python :: django check if user is admin 
Python :: if elseif in single line python 
Python :: python closure 
Python :: how to calculate the sum of a list in python 
Python :: numpy euclidean distance 
Python :: python count bits 
Python :: make pickle file python 
Python :: python create env ubuntu 
Python :: urllib3 python 
Python :: standardise columns python 
Python :: python color input 
Python :: python package version 
Python :: label point matplotlib 
Python :: hex python add 0 
Python :: install quick-mailer 
Python :: how to use csv in python 
Python :: df rename columns 
Python :: cmd check if python is installed 
Python :: pd merge 
Python :: python mean 
Python :: python line_profiler 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =