Pandas doesn't work correctly in Spyder

1,018 views
Skip to first unread message

pblelloch

unread,
Sep 15, 2015, 1:39:49 PM9/15/15
to spyder
By trial and error I've found that pandas won't run in my current version of Spyder.  I'm using Spyder 2.3.6 and Pandas 0.16.2 (Anaconda distribution).  As far as I can everything else works fine, and Pandas works fine outside of Spyder.  In addition the following works fine in Spyder:

import pandas as pd
pd.DataFrame(data=range(10))

But the following causes Spyder to hang:

import pandas as pd
p=pd.DataFrame(data=range(10))

The following also works:

import pandas as pd
hdstore  = pd.HDFStore('python_decimated_data.h5') 
hdstore['dCp']             

While the following causes Spyder to hang:

import pandas as pd
hdstore  = pd.HDFStore('python_decimated_data.h5') 
dCp = hdstore['dCp']             

As far as I can tell I can run Pandas, but when I try to assign a Pandas object to a variable it causes Spyder to hang.  I'm thinking that this is because Spyder is trying to do something to display the variable in the variable explorer and not being successful.

I talked to a couple of other Python programmers here and they had run into exactly the same thing, so it isn't just me.

Big Stone

unread,
Sep 15, 2015, 3:33:51 PM9/15/15
to spyder
on winpython 3.4 / Spyder 2.3.6 :

>>> import pandas as pd
>>> p=pd.DataFrame(data=range(10))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\WinPython\basedir34\build\winpython-3.4.3.amd64\python-3.4.3.amd64\lib\site-packages\pandas\core\frame.py", line 302, in __init__
    raise PandasError('DataFrame constructor not properly called!')
pandas.core.common.PandasError: DataFrame constructor not properly called!
>>>

Paul Blelloch

unread,
Sep 15, 2015, 5:21:52 PM9/15/15
to spyd...@googlegroups.com
It appears that a dataframe no longer accepts a list as data in Python 3.4.  But the following works:

import pandas as pd
import numpy as np
p = pd.DataFrame(data=np.arange(10))

But that still doesn't work with Python 2.7.9 (i.e. it hangs spyder).  In fact, as far as I can tell pandas works just fine with spyder 2.3.6 and Python 3.4.3, but still doesn't with spyder 2.3.6 and Python 2.7.9.

This might push me over the edge into the world of Python 3.x ;-)

--
You received this message because you are subscribed to a topic in the Google Groups "spyder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spyderlib/KHZGwpJDS7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Paul Blelloch

unread,
Sep 15, 2015, 7:20:31 PM9/15/15
to spyd...@googlegroups.com
Someone on the Anaconda list also pointed out that it works with a standard (as opposed to an IPython) console.  So the bug, as far as I can tell, is limited to Spyder 2.3.6 (I haven't checked other versions) with Python 2.7 and the IPython console.

Sean Violante

unread,
Sep 29, 2015, 7:00:45 AM9/29/15
to spyder
You have to downgrade to 2.3.5.2/ wait for 2.3.7

Reply all
Reply to author
Forward
0 new messages