diff --git a/ci/code_checks.sh b/ci/code_checks.sh index cabc25b5e0ba5..89f6992df2cbc 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -131,7 +131,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DatetimeTZDtype.tz SA01" \ -i "pandas.DatetimeTZDtype.unit SA01" \ -i "pandas.Grouper PR02" \ - -i "pandas.HDFStore.info RT03,SA01" \ -i "pandas.HDFStore.keys SA01" \ -i "pandas.HDFStore.put PR01,SA01" \ -i "pandas.HDFStore.select SA01" \ diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index d7fc71d037f2d..89c6ac9a58382 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1688,17 +1688,26 @@ def info(self) -> str: Returns ------- str + A String containing the python pandas class name, filepath to the HDF5 + file and all the object keys along with their respective dataframe shapes. + + See Also + -------- + HDFStore.get_storer : Returns the storer object for a key. Examples -------- - >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"]) + >>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"]) + >>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=["C", "D"]) >>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP - >>> store.put("data", df) # doctest: +SKIP + >>> store.put("data1", df1) # doctest: +SKIP + >>> store.put("data2", df2) # doctest: +SKIP >>> print(store.info()) # doctest: +SKIP >>> store.close() # doctest: +SKIP File path: store.h5 - /data frame (shape->[2,2]) + /data1 frame (shape->[2,2]) + /data2 frame (shape->[2,2]) """ path = pprint_thing(self._path) output = f"{type(self)}\nFile path: {path}\n"