Skip to content

Commit 4f9b34e

Browse files
tpaxmanim-vinicius
authored and
im-vinicius
committed
DOC: update read_clipboard docstring to have proper formatting and all required sections. (pandas-dev#53838)
* add code formatting and reference links to read_clipboard docstring * add extended summary, see-also, and examples sections to ensure docstring is fully validated * hide "pandas" from each :func: and :class: reference * fix typos
1 parent 2db330a commit 4f9b34e

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

pandas/io/clipboards.py

+21-8
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,44 @@ def read_clipboard(
2626
**kwargs,
2727
): # pragma: no cover
2828
r"""
29-
Read text from clipboard and pass to read_csv.
29+
Read text from clipboard and pass to :func:`~pandas.read_csv`.
30+
31+
Parses clipboard contents similar to how CSV files are parsed
32+
using :func:`~pandas.read_csv`.
3033
3134
Parameters
3235
----------
3336
sep : str, default '\\s+'
34-
A string or regex delimiter. The default of '\\s+' denotes
37+
A string or regex delimiter. The default of ``'\\s+'`` denotes
3538
one or more whitespace characters.
3639
3740
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
38-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
41+
Which dtype_backend to use, e.g., whether a DataFrame should have NumPy
3942
arrays, nullable dtypes are used for all dtypes that have a nullable
40-
implementation when "numpy_nullable" is set, pyarrow is used for all
41-
dtypes if "pyarrow" is set.
43+
implementation when ``'numpy_nullable'`` is set, pyarrow is used for all
44+
dtypes if ``'pyarrow'`` is set.
4245
43-
The dtype_backends are still experimential.
46+
The dtype_backends are still experimental.
4447
4548
.. versionadded:: 2.0
4649
4750
**kwargs
48-
See read_csv for the full argument list.
51+
See :func:`~pandas.read_csv` for the full argument list.
4952
5053
Returns
5154
-------
5255
DataFrame
53-
A parsed DataFrame object.
56+
A parsed :class:`~pandas.DataFrame` object.
57+
58+
See Also
59+
--------
60+
DataFrame.to_clipboard : Copy object to the system clipboard.
61+
read_csv : Read a comma-separated values (csv) file into DataFrame.
62+
read_fwf : Read a table of fixed-width formatted lines into DataFrame.
63+
64+
Examples
65+
--------
66+
>>> pd.read_clipboard() # doctest: +SKIP
5467
"""
5568
encoding = kwargs.pop("encoding", "utf-8")
5669

0 commit comments

Comments
 (0)