pandas.HDFStore.select_column
pandas 3.1.1 · Input and output · method
Read a single column from a stored HDF table.
Call syntax
HDFStore.select_column(key, column, start=None, stop=None)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 |
|---|---|---|
key |
Required Positional or keyword |
str Provide the lookup key, or a transformation callable for a sorting method. |
column |
Required Positional or keyword |
str Identify the column or columns to use. |
start |
Optional Positional or keyword Default None |
int or None Supply the start point of a range, slice, or calculation. |
stop |
Optional Positional or keyword Default None |
int or None Provide the endpoint where a slice or generated range stops. |
Returns
Series
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"])
print(store.select_column("orders", "units"))