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,
)
| 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 |