Skip to content

Commit 09c7201

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.HDFStore.info (#58368)
* DOC: add return description and see also section to pandas.HDFStore.info * DOC: add 2 df in the examples for pandas.HDFStore.info * DOC: remove pandas.HDFStore.info
1 parent 2768a22 commit 09c7201

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
125125
-i "pandas.DatetimeTZDtype.tz SA01" \
126126
-i "pandas.DatetimeTZDtype.unit SA01" \
127127
-i "pandas.Grouper PR02" \
128-
-i "pandas.HDFStore.info RT03,SA01" \
129128
-i "pandas.HDFStore.keys SA01" \
130129
-i "pandas.HDFStore.put PR01,SA01" \
131130
-i "pandas.HDFStore.select SA01" \

pandas/io/pytables.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -1688,17 +1688,26 @@ def info(self) -> str:
16881688
Returns
16891689
-------
16901690
str
1691+
A String containing the python pandas class name, filepath to the HDF5
1692+
file and all the object keys along with their respective dataframe shapes.
1693+
1694+
See Also
1695+
--------
1696+
HDFStore.get_storer : Returns the storer object for a key.
16911697
16921698
Examples
16931699
--------
1694-
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
1700+
>>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
1701+
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=["C", "D"])
16951702
>>> store = pd.HDFStore("store.h5", "w") # doctest: +SKIP
1696-
>>> store.put("data", df) # doctest: +SKIP
1703+
>>> store.put("data1", df1) # doctest: +SKIP
1704+
>>> store.put("data2", df2) # doctest: +SKIP
16971705
>>> print(store.info()) # doctest: +SKIP
16981706
>>> store.close() # doctest: +SKIP
16991707
<class 'pandas.io.pytables.HDFStore'>
17001708
File path: store.h5
1701-
/data frame (shape->[2,2])
1709+
/data1 frame (shape->[2,2])
1710+
/data2 frame (shape->[2,2])
17021711
"""
17031712
path = pprint_thing(self._path)
17041713
output = f"{type(self)}\nFile path: {path}\n"

0 commit comments

Comments
 (0)