Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you copy paste values in PyCharm dataframe view?

Tags:

pycharm

I'm using pycharm dataframe view to inspect my dataframe. I wanted to copy paste the value in one cell. I select the cell, hit command+C, but it doesn't work. The 'copy' item in dropdown menu is grey and not selectable. How can I copy paste from dataframe view?

Pycharm version: 2017.3.3 MAC OS X

like image 699
Vicky Avatar asked Jan 25 '18 20:01

Vicky


People also ask

How do I visualize a DataFrame in PyCharm?

In the Variables tab of the Debug tool window, select an array or a DataFrame. Click a link View as Array/View as DataFrame to the right. Alternatively, you can choose View as Array or View as DataFrame from the context menu.

Where are variables stored in PyCharm?

In PyCharm the debug toolkit is opened as a tab at the bottom of the screen. In the bottom right we see the variable explorer which gives us the name, type and value of all the variables in scope.


1 Answers

This isn't exactly what you wanted but if you right click in the debug variables menu on the variable that represents your dataframe click "Evaluate Expression" and insert the following and click evaluate:

df1.to_clipboard(sep=',')

Where df1 is replaced with the name of your dataframe. Then you can paste anywhere and pull out the values you need.

source: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_clipboard.html

like image 189
Alex Avatar answered Sep 23 '22 03:09

Alex