Skip to content

Io to clipboard #3845

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 4 commits into from
Jun 13, 2013
Merged
Changes from 2 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
33 changes: 33 additions & 0 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,39 @@ And then import the data directly to a DataFrame by calling:

clipdf

.. note::

You may need to install xsel on Linux to be able to read from the clipboard.

The ``to_clipboard`` method can be used to write the contents of a DataFrame to
the clipboard. Following which you can paste the clipboard contents into other
applications (CTRL-V on many operating systems). Here we illustrate writing a
DataFrame into clipboard and reading it back.

.. ipython:: python

df=pd.DataFrame(randn(5,3))

.. ipython:: python

df

.. ipython:: python

df.to_clipboard()

.. ipython:: python

obj=pd.read_clipboard()
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need to asssign here...just pd.read_clipboard() (its like ipython, will just print the results)

also...these can all be in a single ipython:: python directive

and giong to need to change the note to conform with #3848

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do i need to send another PR? or can this be edited?


.. ipython:: python

obj

We can see that we got the same content back, which we had earlier written to the clipboard.




.. _io.excel:

Expand Down