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

Method get

pandas/io/pytables.py:804–837  ·  view source on GitHub ↗

Retrieve pandas object stored in file. Parameters ---------- key : str Object to retrieve from file. Raises KeyError if not found. Returns ------- object Same type as object stored in file. See Also -

(self, key: str)

Source from the content-addressed store, hash-verified

802 os.fsync(self._handle.fileno())
803
804 def get(self, key: str):
805 """
806 Retrieve pandas object stored in file.
807
808 Parameters
809 ----------
810 key : str
811 Object to retrieve from file. Raises KeyError if not found.
812
813 Returns
814 -------
815 object
816 Same type as object stored in file.
817
818 See Also
819 --------
820 HDFStore.get_node : Returns the node with the key.
821 HDFStore.get_storer : Returns the storer object for a key.
822
823 Examples
824 --------
825 >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
826 >>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP
827 >>> store.put("data", df) # doctest: +SKIP
828 >>> store.get("data") # doctest: +SKIP
829 >>> store.close() # doctest: +SKIP
830 """
831 with patch_pickle():
832 # GH#31167 Without this patch, pickle doesn't know how to unpickle
833 # old DateOffset objects now that they are cdef classes.
834 group = self.get_node(key)
835 if group is None:
836 raise KeyError(f"No object named {key} in the file")
837 return self._read_group(group)
838
839 def select(
840 self,

Callers 15

__getitem__Method · 0.95
__getattr__Method · 0.95
test_multiple_open_closeFunction · 0.95
convertMethod · 0.45
maybe_set_sizeMethod · 0.45
update_infoMethod · 0.45
set_infoMethod · 0.45
_class_to_aliasMethod · 0.45
_alias_to_classMethod · 0.45
validate_data_columnsMethod · 0.45
readMethod · 0.45

Calls 3

get_nodeMethod · 0.95
_read_groupMethod · 0.95
patch_pickleFunction · 0.90

Tested by 1

test_multiple_open_closeFunction · 0.76