pandas 1.4.2

NotesParameters
to_clipboard(self, excel: 'bool_t' = True, sep: 'str | None' = None, **kwargs) -> 'None'

Write a text representation of object to the system clipboard. This can be pasted into Excel, for example.

Notes

Requirements for your platform.

Parameters

excel : bool, default True

Produce output in a csv format for easy pasting into excel.

  • True, use the provided separator for csv pasting.

  • False, write a string representation of the object to the clipboard.

sep : str, default ``'\t'``

Field delimiter.

**kwargs :

These parameters will be passed to DataFrame.to_csv.

Copy object to the system clipboard.

See Also

DataFrame.to_csv

Write a DataFrame to a comma-separated values (csv) file.

read_clipboard

Read text from clipboard and pass to read_csv.

Examples

Copy the contents of a DataFrame to the clipboard.

This example is valid syntax, but we were not able to check execution
>>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['A', 'B', 'C'])
This example is valid syntax, but we were not able to check execution
>>> df.to_clipboard(sep=',')  # doctest: +SKIP
... # Wrote the following to the system clipboard:
... # ,A,B,C
... # 0,1,2,3
... # 1,4,5,6

We can omit the index by passing the keyword :None:None:`index` and setting it to false.

This example is valid syntax, but we were not able to check execution
>>> df.to_clipboard(sep=',', index=False)  # doctest: +SKIP
... # Wrote the following to the system clipboard:
... # A,B,C
... # 1,2,3
... # 4,5,6
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/generic.py#3034
type: <class 'function'>
Commit: