Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable explorer is not recognizing Pandas Series objects #2815

Closed
lonestar79 opened this issue Nov 17, 2015 · 12 comments
Closed

Variable explorer is not recognizing Pandas Series objects #2815

lonestar79 opened this issue Nov 17, 2015 · 12 comments

Comments

@lonestar79
Copy link

I have just installed the latest Anaconda package available on Anaconda website. I have now Spyder 2.3.7 running with Python 3.5. Operating system is OSX El Capitan 10.11 running on a newly purchased iMac. I also have a 3 year old MacBook Air running Spyder 2.3.5.2 with Python 3.4.3-2.

On the new iMac, I run a python file which creates some large dict objects. However, only one of these dict objects show up in the Variable explorer. The others don't. When I run the same python file on my old MacBook Air, all the dict objects show up in Variable explorer. Can anyone help please? I searched for an answer online but can not find anything. Thank you.

@ccordoba12
Copy link
Member

Some comments:

  1. We reduced the default number of elements shown in the Variable Explorer to avoid huge slowdowns when people create big dicts or lists.
  2. You can still inspect what contents your dict has, by doing a double click on its entry in the Variable Explorer.

Do they help?


Could you upload the code you're using, or at least post an screenshot of what you're seeing? That would be more helpful to understand your problem :-)

@lonestar79
Copy link
Author

Thank you Carlos. Let me try to explain further. When I use dir() command in the iPython console, I get a full list of dict objects in memory. Some of these dict objects are not listed in the Variable explorer above. Some other dicts are listed. This is the issue. Did this explain a bit more?

My code is quite long unfortunately. Here is something I observed: The dictionaries that are directly loaded to memory using pickle.load are visible in Variable explorer. However, the dictionaries that are created by populating them in a for-loop are not visible in Variable explorer.

I don't get this problem if I install the previous version of Anaconda. However I get a different problem in the previous version of Anaconda (iPyhthon console is extremely slow... Stops responding for a few seconds every time I start typing).

Appreciate any help.

@lonestar79
Copy link
Author

If I convert the invisible dict into a data frame using pd.DataFrame(), then the resulting object shows up in the Variable explorer.

@lonestar79
Copy link
Author

Contents of the invisible dict object are pandas time series objects. So, for each key in the dict, there is a separate pandas time series object.

@lonestar79
Copy link
Author

Made some progress in understanding the issue. When I go to Preferences>Variable Explorer and uptick "Exclude Unsupported Variable Types", then the dictionary shows up in Variable Explorer. When I double click on the dict to view the contents, I see that the Type of the contents are core.series.Series. Instead of this, it should be saying TimeSeries. So somehow Variable Explorer doesn't recognise Series objects from Pandas package. However it does recognise the DataFrame objects.

@lonestar79
Copy link
Author

**uptick should be untick (autocorrect issue...)

@ccordoba12 ccordoba12 changed the title Spyder's Variable explorer is inconsistent when it lists dict objects Variable explorer is not recognizing Pandas Series objects Nov 18, 2015
@ccordoba12 ccordoba12 added this to the v2.3.8 milestone Nov 18, 2015
@ccordoba12
Copy link
Member

Thanks for finding the root cause of your problem. This happens because since Pandas 0.17 Series and TimeSeries are two different (although equivalent) objects.

I'll fix this problem in Spyder 2.3.8, to be released later this week.

@joy2014
Copy link

joy2014 commented Nov 20, 2015

thank you, ccordoba12.
I downgraded pandas from 0.17 to 0.16.2 as of now and i will update pandas with spyder when 2.3.8 releases.

@ccordoba12
Copy link
Member

@joy2014, it's worth noting that TimeSeries support in the Variable Explorer will be removed in 2.3.8 because it was deprecated in Pandas.

So from 2.3.8 onwards we will only support Series :-)

@Nodd
Copy link
Contributor

Nodd commented Nov 21, 2015

@ccordoba12 Deprecated does not mean that no one will use it in the near future. Maybe we should wait a bit before removing them from spyder. I'd say at least 3.0, doing it in a minor revision is surprising.

@ccordoba12
Copy link
Member

@Nodd and @joy2014, sorry, I was wrong! TimeSeries is a subclass of Series since 0.17, so it'll also be shown in our Variable Explorer :-)

@Nodd
Copy link
Contributor

Nodd commented Nov 21, 2015

Nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants