Examples
Following example copy the contents of a DataFrame to the clipboard:
import numpy as np
import pandas as pd
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.
df.to_clipboard(sep=',', index=False)
# Wrote the following to the system clipboard:
# P,Q,R
# 2,3,4
# 5,6,7