copy pandas Excel Dataframe to clipboard without index header

Viewed 1270

I have an Excel file from Where I have to copy some subset of data to the clipboard so that I can paste it to any place. I am using pandas DataFrame.to_clipboard(excel=True, sep=None, **kwargs) function but I don't want index headers to be copied.

What it is copying is this:

Excel Copied

What I want to copy is this only:

enter image description here

1 Answers

you have to pass two parameters for that : index and header.

DataFrame.to_clipboard(excel=True, sep=None, index=False, header=None)
Related