Skip to content

Commit e7488f1

Browse files
committed
Merge pull request #3845 from nipunreddevil/io-to-clipboard
Io to clipboard
2 parents 863478c + be1931c commit e7488f1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/source/io.rst

+20
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,26 @@ And then import the data directly to a DataFrame by calling:
13581358
13591359
clipdf
13601360
1361+
The ``to_clipboard`` method can be used to write the contents of a DataFrame to
1362+
the clipboard. Following which you can paste the clipboard contents into other
1363+
applications (CTRL-V on many operating systems). Here we illustrate writing a
1364+
DataFrame into clipboard and reading it back.
1365+
1366+
.. ipython:: python
1367+
1368+
df=pd.DataFrame(randn(5,3))
1369+
df
1370+
df.to_clipboard()
1371+
pd.read_clipboard()
1372+
1373+
We can see that we got the same content back, which we had earlier written to the clipboard.
1374+
1375+
.. note::
1376+
1377+
You may need to install xclip or xsel (with gtk or PyQt4 modules) on Linux to use these methods.
1378+
1379+
1380+
13611381

13621382
.. _io.excel:
13631383

0 commit comments

Comments
 (0)