jupyter server dfdata.to_clipboard from remote to local machine. how?

Viewed 2581

I have a dataframe say dfdata in a jupyter server notebook running on a remote machine).

I want to access the dataframe in the remote machine memory to my local machine, say to paste the dfdata to Excel.

Normally (when the notebook server is running locally), I do dfdata.to_clipboard() to copy the dataframe to clipboard and now able to paste it to Excel.

However, since the dfdata is now on the remote machine, the dfdata.to_clipboard() does not have the copy of the dataframe in clipboard.

How to make this work, i.e. copy paste dataframe from remote machine to locally running Excel, Textfile, etc.? Any alternative methods, if to_clipboard() by design will not work across remote server due to any security restrictions / limitations.

3 Answers

As an alternative you can use copydf - github and pypi.

This should be as simple as pip install copydf.

Then in your jupyter session:

from copydf import copyDF
copyDf( df )
Related