pandas.DataFrame.to_clipboard

pandas 3.1.1 · DataFrame · method

Copy the object's textual table representation to the system clipboard.

Call syntax

DataFrame.to_clipboard(*, excel=True, sep=None, **kwargs)

Inspect the call

Run this code to inspect the callable and its parameters. Its data, backend, or environment is needed to execute the operation itself.

Parameters

ParameterRequirementAccepted values and behavior
excel Optional
Keyword only
Default True
bool
sep Optional
Keyword only
Default None
str

Specify the separator between fields or string pieces.

**kwargs Optional
Additional keyword arguments

Returns

None

Example for a local Python session

import pandas as pd

orders = pd.DataFrame({"units": [2, 5]})
orders.to_clipboard(index=False)