From 96d2d9d550498160a5cbe08e3f7c6988e1459e7a Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Fri, 7 Jun 2019 08:48:22 +0100 Subject: [PATCH] DOC: Not running clipboard examples in the doc --- doc/source/user_guide/io.rst | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 4aacb6fa1e278..9d272ccc34893 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -3249,11 +3249,12 @@ And then import the data directly to a ``DataFrame`` by calling: .. code-block:: python - clipdf = pd.read_clipboard() - -.. ipython:: python - - clipdf + >>> clipdf = pd.read_clipboard() + >>> clipdf + A B C + x 1 4 p + y 2 5 q + z 3 6 r The ``to_clipboard`` method can be used to write the contents of a ``DataFrame`` to @@ -3261,12 +3262,23 @@ 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 +.. code-block:: python - df = pd.DataFrame(np.random.randn(5, 3)) - df - df.to_clipboard() - pd.read_clipboard() + >>> df = pd.DataFrame({'A': [1, 2, 3], + ... 'B': [4, 5, 6], + ... 'C': ['p', 'q', 'r']}, + ... index=['x', 'y', 'z']) + >>> df + A B C + x 1 4 p + y 2 5 q + z 3 6 r + >>> df.to_clipboard() + >>> pd.read_clipboard() + A B C + x 1 4 p + y 2 5 q + z 3 6 r We can see that we got the same content back, which we had earlier written to the clipboard.