MCPcopy
hub / github.com/pandas-dev/pandas / select_column

Method select_column

pandas/io/pytables.py:970–1008  ·  view source on GitHub ↗

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.

(
        self,
        key: str,
        column: str,
        start: int | None = None,
        stop: int | None = None,
    )

Source from the content-addressed store, hash-verified

968 return tbl.read_coordinates(where=where, start=start, stop=stop)
969
970 def select_column(
971 self,
972 key: str,
973 column: str,
974 start: int | None = None,
975 stop: int | None = None,
976 ):
977 """
978 return a single column from the table. This is generally only useful to
979 select an indexable
980
981 .. warning::
982
983 Pandas uses PyTables for reading and writing HDF5 files, which allows
984 serializing object-dtype data with pickle when using the "fixed" format.
985 Loading pickled data received from untrusted sources can be unsafe.
986
987 See: https://docs.python.org/3/library/pickle.html for more.
988
989 Parameters
990 ----------
991 key : str
992 column : str
993 The column of interest.
994 start : int or None, default None
995 stop : int or None, default None
996
997 Raises
998 ------
999 raises KeyError if the column is not found (or key is not a valid
1000 store)
1001 raises ValueError if the column can not be extracted individually (it
1002 is part of a data block)
1003
1004 """
1005 tbl = self.get_storer(key)
1006 if not isinstance(tbl, Table):
1007 raise TypeError("can only read_column with a table")
1008 return tbl.read_column(column=column, start=start, stop=stop)
1009
1010 def select_as_multiple(
1011 self,

Callers 3

test_read_columnFunction · 0.80

Calls 2

get_storerMethod · 0.95
read_columnMethod · 0.80

Tested by 3

test_read_columnFunction · 0.64