Skip to content

DOC: update read_clipboard docstring to have proper formatting and all required sections. #53838

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 5 commits into from
Jun 26, 2023
Merged
Changes from all commits
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
29 changes: 21 additions & 8 deletions pandas/io/clipboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,44 @@ def read_clipboard(
**kwargs,
): # pragma: no cover
r"""
Read text from clipboard and pass to read_csv.
Read text from clipboard and pass to :func:`~pandas.read_csv`.

Parses clipboard contents similar to how CSV files are parsed
using :func:`~pandas.read_csv`.

Parameters
----------
sep : str, default '\\s+'
A string or regex delimiter. The default of '\\s+' denotes
A string or regex delimiter. The default of ``'\\s+'`` denotes
one or more whitespace characters.

dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
Which dtype_backend to use, e.g., whether a DataFrame should have NumPy
arrays, nullable dtypes are used for all dtypes that have a nullable
implementation when "numpy_nullable" is set, pyarrow is used for all
dtypes if "pyarrow" is set.
implementation when ``'numpy_nullable'`` is set, pyarrow is used for all
dtypes if ``'pyarrow'`` is set.

The dtype_backends are still experimential.
The dtype_backends are still experimental.

.. versionadded:: 2.0

**kwargs
See read_csv for the full argument list.
See :func:`~pandas.read_csv` for the full argument list.

Returns
-------
DataFrame
A parsed DataFrame object.
A parsed :class:`~pandas.DataFrame` object.

See Also
--------
DataFrame.to_clipboard : Copy object to the system clipboard.
read_csv : Read a comma-separated values (csv) file into DataFrame.
read_fwf : Read a table of fixed-width formatted lines into DataFrame.

Examples
--------
>>> pd.read_clipboard() # doctest: +SKIP
"""
encoding = kwargs.pop("encoding", "utf-8")

Expand Down