Repository: spyder-ide/spyder

Issue:
Cannot see numpy datatypes in variable explorer
## Description of your problem

I have installed Spyder 2.7 and Spyder 3.5 from Anaconda. I am creating numpy arrays in Spyder but the data is not visible in the variable explorer in case of Spyder 2.7.

**Code to reproduce the issue**
hello = [1,2,3,4,5]
hello = np.array(hello)

**What is the expected output? What do you see instead?**
Should display the numpy datatype variables in the variable explorer.

**Please provide any additional information below**

![image](https://cloud.githubusercontent.com/assets/815486/19313614/1d0f5ece-9065-11e6-8085-7adbb0a61d7c.png)

(C:\Users\Jagan\Anaconda3\envs\Python27) C:\Users\Jagan>conda info
Current conda install:

```
           platform : win-64
      conda version : 4.2.9
   conda is private : False
  conda-env version : 4.2.9
conda-build version : 1.21.3
     python version : 3.5.2.final.0
   requests version : 2.11.1
   root environment : C:\Users\Jagan\Anaconda3  (writable)
default environment : C:\Users\Jagan\Anaconda3\envs\Python27
   envs directories : C:\Users\Jagan\Anaconda3\envs
      package cache : C:\Users\Jagan\Anaconda3\pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/win-64/
                      https://repo.continuum.io/pkgs/free/noarch/
                      https://repo.continuum.io/pkgs/pro/win-64/
                      https://repo.continuum.io/pkgs/pro/noarch/
                      https://repo.continuum.io/pkgs/msys2/win-64/
                      https://repo.continuum.io/pkgs/msys2/noarch/
        config file : None
       offline mode : False
```
## Versions and main components
- Spyder Version: 2.7
- Python Version: 2.7
- Operating system: Windows 10
## Dependencies

jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.3 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.3.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.5.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.3.1 (OK)
sympy >=0.7.3    :  1.0 (OK)



Discussion:
This is the same error message as in #3502.

@jaganmohan, could you give us the code you're using to generate your `hello` or `helloMSE` arrays, so we can test this problem in our side?

I have updated the issue with the code used for generating hello

Thanks!


Resolving patch:
diff --git a/spyder/utils/ipython/spyder_kernel.py b/spyder/utils/ipython/spyder_kernel.py
--- a/spyder/utils/ipython/spyder_kernel.py
+++ b/spyder/utils/ipython/spyder_kernel.py
@@ -299,14 +299,20 @@ def _is_series(self, var):
     def _get_array_shape(self, var):
         """Return array's shape"""
         try:
-            return var.shape
+            if self._is_array(var):
+                return var.shape
+            else:
+                return None
         except AttributeError:
             return None
 
     def _get_array_ndim(self, var):
         """Return array's ndim"""
         try:
-            return var.ndim
+            if self._is_array(var):
+                return var.ndim
+            else:
+                return None
         except AttributeError:
             return None
 


Test patch: