awswrangler.dynamodb.put_df¶
- awswrangler.dynamodb.put_df(df: DataFrame, table_name: str, boto3_session: Session | None = None, use_threads: bool | int = True) None ¶
Write all items from a DataFrame to a DynamoDB.
Note
Following arguments are not supported in distributed mode with engine EngineEnum.RAY:
boto3_session
Note
This function has arguments which can be configured globally through wr.config or environment variables:
Check out the Global Configurations Tutorial for details.
- Parameters:
df (
DataFrame
) – Pandas DataFrametable_name (
str
) – Name of the Amazon DynamoDB table.use_threads (
bool
|int
) – Used for Parallel Write requests. True (default) to enable concurrency, False to disable multiple threads. If enabled os.cpu_count() is used as the max number of threads. If integer is provided, specified number is used.boto3_session (
Session
|None
) – The default boto3 session will be used if boto3_session isNone
.
- Return type:
None
Examples
Writing rows of DataFrame
>>> import awswrangler as wr >>> import pandas as pd >>> wr.dynamodb.put_df( ... df=pd.DataFrame({'key': [1, 2, 3]}), ... table_name='table' ... )