Skip to content

Commit eb768af

Browse files
attack68yehoshuadimarsky
authored andcommitted
DOC: example using clipboard_set for all output formats (pandas-dev#46311)
1 parent c9167bd commit eb768af

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/core/generic.py

+11
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,9 @@ def to_clipboard(
30583058
- Windows : none
30593059
- macOS : none
30603060
3061+
This method uses the processes developed for the package `pyperclip`. A
3062+
solution to render any output string format is given in the examples.
3063+
30613064
Examples
30623065
--------
30633066
Copy the contents of a DataFrame to the clipboard.
@@ -3078,6 +3081,14 @@ def to_clipboard(
30783081
... # A,B,C
30793082
... # 1,2,3
30803083
... # 4,5,6
3084+
3085+
Using the original `pyperclip` package for any string output format.
3086+
3087+
.. code-block:: python
3088+
3089+
import pyperclip
3090+
html = df.style.to_html()
3091+
pyperclip.copy(html)
30813092
"""
30823093
from pandas.io import clipboards
30833094

0 commit comments

Comments
 (0)