diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index fe34f009165ac..18c2a761277f1 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1994,9 +1994,8 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str): self.values = new_pd_index def take_data(self): - """ return the values & release the memory """ - self.values, values = None, self.values - return values + """ return the values""" + return self.values @property def attrs(self): @@ -2249,9 +2248,8 @@ def set_data(self, data: Union[np.ndarray, ABCExtensionArray]): self.kind = _dtype_to_kind(dtype_name) def take_data(self): - """ return the data & release the memory """ - self.data, data = None, self.data - return data + """ return the data """ + return self.data @classmethod def _get_atom(cls, values: Union[np.ndarray, ABCExtensionArray]) -> "Col":