pandas.HDFStore.select_as_multiple
pandas 3.1.1 · Input and output · method
Read and combine columns from several HDFStore tables that share corresponding rows.
Call syntax
HDFStore.select_as_multiple(…) Full signature
HDFStore.select_as_multiple(
keys,
where=None,
selector=None,
columns=None,
start=None,
stop=None,
iterator=False,
chunksize=None,
auto_close=False,
)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 |
|---|---|---|
keys |
Required Positional or keyword |
list of str Provide grouping, dictionary, index, or concatenation keys for this operation. |
where |
Optional Positional or keyword Default None |
list Select data using a criterion or specify the label at which to look up a value. |
selector |
Optional Positional or keyword Default None |
str |
columns |
Optional Positional or keyword Default None |
list Supply column labels or control how columns are handled. |
start |
Optional Positional or keyword Default None |
int Supply the start point of a range, slice, or calculation. |
stop |
Optional Positional or keyword Default None |
int Provide the endpoint where a slice or generated range stops. |
iterator |
Optional Positional or keyword Default False |
bool Request an iterable reader so data can be consumed in pieces. |
chunksize |
Optional Positional or keyword Default None |
int Set how many rows to read or write in each batch. |
auto_close |
Optional Positional or keyword Default False |
bool |
Returns
DataFrame or TableIterator
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.select_as_multiple(["quantities", "prices"]))