Skip to content

Commit ff4f313

Browse files
committed
DOC: default for clipboard parsing is to parse whitespace
1 parent 8d7d4c2 commit ff4f313

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/source/io.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ Clipboard
14051405

14061406
A handy way to grab data is to use the ``read_clipboard`` method, which takes
14071407
the contents of the clipboard buffer and passes them to the ``read_table``
1408-
method described in the next section. For instance, you can copy the following
1408+
method. For instance, you can copy the following
14091409
text to the clipboard (CTRL-C on many operating systems):
14101410

14111411
.. code-block:: python
@@ -1419,7 +1419,7 @@ And then import the data directly to a DataFrame by calling:
14191419

14201420
.. code-block:: python
14211421
1422-
clipdf = pd.read_clipboard(delim_whitespace=True)
1422+
clipdf = pd.read_clipboard()
14231423
14241424
.. ipython:: python
14251425

pandas/io/clipboard.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def read_clipboard(**kwargs): # pragma: no cover
1010
-------
1111
parsed : DataFrame
1212
"""
13+
if kwargs.get('sep') is None and kwargs.get('delim_whitespace') is None:
14+
kwargs['sep'] = '\s+'
1315
from pandas.util.clipboard import clipboard_get
1416
from pandas.io.parsers import read_table
1517
text = clipboard_get()

0 commit comments

Comments
 (0)