pandas.HDFStore.select_as_coordinates#

HDFStore.select_as_coordinates(key, where=None, start=None, stop=None)[source]#

Return the selection as an Index.

Warning

Pandas uses PyTables for reading and writing HDF5 files, which allows serializing object-dtype data with pickle when using the “fixed” format. Loading pickled data received from untrusted sources can be unsafe.

See: https://docs.python.org/3/library/pickle.html for more.

Parameters:
keystr

Object being retrieved from file.

wherelist of Term (or convertible) objects, optional

Conditions to apply to the selection. start and stop are applied to the table before where.

startint, optional

Row number to start selection.

stopint, optional

Row number to stop selection.

Returns:
Index

Integer positions of the matching rows; can be passed as where to a subsequent select.

See also

HDFStore.select

Retrieve a stored object, optionally filtered by where.

HDFStore.select_as_multiple

Retrieve pandas objects from multiple tables.

Examples

>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
>>> store = pd.HDFStore("store.h5", "w")
>>> store.append(
...     "data", df, format="table", data_columns=["A"]
... )
>>> store.select_as_coordinates("data", "A>1")
>>> store.close()