Examples
Following example copy the contents of a DataFrame to the clipboard:

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame([[2, 3, 4], [5, 6, 7]], columns=['P', 'Q', 'R'])
df.to_clipboard(sep=',')
# Wrote the following to the system clipboard:
# ,P,Q,R
# 0,2,3,4
# 1,5,6,7

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

In [3]:
df.to_clipboard(sep=',', index=False)
# Wrote the following to the system clipboard:
# P,Q,R
# 2,3,4
# 5,6,7