PyCharm Console Hangs with Big Objects

I use PyCharm and usually run parts of my scripts on my Python console for debugging purposes. However, when I need to run something on a "large" variable (which consumes a lot of memory), the console becomes very slow.

Tell me df- a huge data frame pandas, as soon as I type df.in the console, it will no longer respond for 10-15 seconds. I can’t say if this is a pandas specification, since the only "big" variables that I use are pandas.

I am running the community version 3.4.1, pandas 0.14, Python 2.7.3, on Mac OS X 10.9.4 (with 8 GB of RAM).

Size df:

In[94]: df.values.nbytes + df.index.nbytes + df.columns.nbytes
Out[94]: 2229198184
+4
source share
1 answer

I had the same problem, and I still need to find the right solution, but this is a workaround that I used from PyCharm, which has been hanging in the iPython console with big data for a long time .

Instead of typing, df.columnsenter d.columnsand then go back and add f. This at least prevents freezes, although it makes autocompletion a little useless.

0
source

All Articles