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

Method select

pandas/io/pytables.py:839–936  ·  view source on GitHub ↗

Retrieve pandas object stored in file, optionally based on where criteria. .. 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 d

(
        self,
        key: str,
        where=None,
        start=None,
        stop=None,
        columns=None,
        iterator: bool = False,
        chunksize: int | None = None,
        auto_close: bool = False,
    )

Source from the content-addressed store, hash-verified

837 return self._read_group(group)
838
839 def select(
840 self,
841 key: str,
842 where=None,
843 start=None,
844 stop=None,
845 columns=None,
846 iterator: bool = False,
847 chunksize: int | None = None,
848 auto_close: bool = False,
849 ):
850 """
851 Retrieve pandas object stored in file, optionally based on where criteria.
852
853 .. warning::
854
855 Pandas uses PyTables for reading and writing HDF5 files, which allows
856 serializing object-dtype data with pickle when using the "fixed" format.
857 Loading pickled data received from untrusted sources can be unsafe.
858
859 See: https://docs.python.org/3/library/pickle.html for more.
860
861 Parameters
862 ----------
863 key : str
864 Object being retrieved from file.
865 where : list or None
866 List of Term (or convertible) objects, optional.
867 start : int or None
868 Row number to start selection.
869 stop : int, default None
870 Row number to stop selection.
871 columns : list or None
872 A list of columns that if not None, will limit the return columns.
873 iterator : bool or False
874 Returns an iterator.
875 chunksize : int or None
876 Number or rows to include in iteration, return an iterator.
877 auto_close : bool or False
878 Should automatically close the store when finished.
879
880 Returns
881 -------
882 object
883 Retrieved object from file.
884
885 See Also
886 --------
887 HDFStore.select_as_coordinates : Returns the selection as an index.
888 HDFStore.select_column : Returns a single column from the table.
889 HDFStore.select_as_multiple : Retrieves pandas objects from multiple tables.
890
891 Examples
892 --------
893 >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
894 >>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP
895 >>> store.put("data", df) # doctest: +SKIP
896 >>> store.get("data") # doctest: +SKIP

Callers 15

read_hdfFunction · 0.95
select_as_multipleMethod · 0.95
copyMethod · 0.95
test_multiple_open_closeFunction · 0.95
time_read_store_tableMethod · 0.45
_load_backendFunction · 0.45
read_metadataMethod · 0.45
_parse_thead_trMethod · 0.45

Calls 6

get_nodeMethod · 0.95
_create_storerMethod · 0.95
get_resultMethod · 0.95
_ensure_termFunction · 0.85
TableIteratorClass · 0.85
infer_axesMethod · 0.80

Tested by 15

test_multiple_open_closeFunction · 0.76
test_dst_transitionsFunction · 0.36
test_categoricalFunction · 0.36
test_encodingFunction · 0.36
test_select_with_dupsFunction · 0.36
test_selectFunction · 0.36