pandas.HDFStore.select_column#
- HDFStore.select_column(key, column, start=None, stop=None)[source]#
Return a single column from the table.
This is generally only useful to select an indexable.
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.
- columnstr
The column of interest.
- startint or None, default None
Row number to start selection.
- stopint or None, default None
Row number to stop selection.
- Returns:
- Series
A
Seriesof the column’s values.
- Raises:
- KeyError
If the column is not found, or
keyis not a valid store.- ValueError
If the column cannot be extracted individually (not an indexable or a data column).
See also
HDFStore.selectRetrieve a stored object, optionally filtered by
where.HDFStore.select_as_coordinatesReturn the matching row coordinates as an Index.
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_column("data", "A") >>> store.close()