Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.HDFStore.info #58368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,23 +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.
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
<class 'pandas.io.pytables.HDFStore'>
File path: store.h5
/data frame (shape->[2,2])
/data1 frame (shape->[2,2])
/data2 frame (shape->[2,2])
"""
Comment on lines 1697 to 1711
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mroeschke I took the liberty to refine the example by adding one more dataframe. Let me know if this is good or I need to revert back.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thanks for the addition

path = pprint_thing(self._path)
output = f"{type(self)}\nFile path: {path}\n"
Expand Down