pandas.HDFStore.append_to_multiple
pandas 3.1.1 · Input and output · method
Split columns between related HDF tables and append the new rows to them.
Call syntax
HDFStore.append_to_multiple(d, value, selector, data_columns=None, axes=None, dropna=…, **kwargs)Inspect the call
Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
d |
Required Positional or keyword |
dict |
value |
Required Positional or keyword |
DataFrame or Series Provide the value used for the documented operation, such as a replacement or a test point. |
selector |
Required Positional or keyword |
str |
data_columns |
Optional Positional or keyword Default None |
list of str or True |
axes |
Optional Positional or keyword Default None |
default None |
dropna |
Optional Positional or keyword |
bool Choose whether to drop missing values or missing keys from consideration. |
**kwargs |
Optional Additional keyword arguments |
Returns
None
Example for a local Python session
import pandas as pd
from pathlib import Path
from tempfile import TemporaryDirectory
import tables
frame = pd.DataFrame({"units": [2, 5], "price": [4, 3]})
with TemporaryDirectory() as folder:
path = Path(folder) / "demo.h5"
with pd.HDFStore(path, mode="w") as store:
store.put("orders", frame, format="table", data_columns=["units"])
store.append_to_multiple({"quantities": ["units"], "prices": ["price"]}, frame, selector="quantities")
print(store.keys())