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

Error while look to the first emplacement of a scalar numpy array #8149

Closed
PoissonChasseur opened this issue Oct 27, 2018 · 3 comments
Closed

Comments

@PoissonChasseur
Copy link

PoissonChasseur commented Oct 27, 2018

Description

What steps will reproduce the problem?

(Step #1 to #3 can be skip)

  1. With PyTorch, calculate the mean of tensor of 60000x28x28 in float64 with value between [0,1]
  2. Save this result in a variable "a"
  3. b = a.numpy() to get the variable in a array of size [1] with the value.
  4. Try to do: a.numpy()[0] or b[0]

Note in fact, this issue could probably just be closed. The Spyder "Issue report" just open when I got this error.

Traceback

  File "/home/vincent/miniconda2/envs/PyTorch/lib/python2.7/site-packages/spyder/widgets/variableexplorer/arrayeditor.py", line 395, in setEditorData
    text = from_qvariant(index.model().data(index, Qt.DisplayRole), str)
  File "/home/vincent/miniconda2/envs/PyTorch/lib/python2.7/site-packages/spyder/widgets/variableexplorer/arrayeditor.py", line 257, in data
    value = self.get_value(index)
  File "/home/vincent/miniconda2/envs/PyTorch/lib/python2.7/site-packages/spyder/widgets/variableexplorer/arrayeditor.py", line 250, in get_value
    value = self._data[i, j]
IndexError: too many indices for array

Versions

  • Spyder version: 3.3.1
  • Python version: 2.7.15
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Linux 4.15.0-36-generic

Dependencies

pyflakes >=0.5.0  :  2.0.0 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.7.9 (OK)
rope >=0.9.4      :  0.11.0 (OK)
jedi >=0.9.0      :  0.12.1 (OK)
psutil >=0.3      :  5.4.7 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
numpy >=1.7       :  1.15.1 (OK)
sympy >=0.7.3     :  1.2 (OK)
cython >=0.21     :  0.28.5 (OK)
qtconsole >=4.2.0 :  4.4.1 (OK)
IPython >=4.0;<6.0:  5.8.0 (OK)
matplotlib >=2.0.0:  2.2.3 (OK)
pylint >=0.25     :  1.9.2 (OK)
@PoissonChasseur PoissonChasseur changed the title I was just looking to float64 Look to value of float64 in the Variable explorer and got an error Oct 27, 2018
@PoissonChasseur PoissonChasseur changed the title Look to value of float64 in the Variable explorer and got an error Look to value of a float64 value in the variable explorer and got an error Oct 27, 2018
@PoissonChasseur PoissonChasseur changed the title Look to value of a float64 value in the variable explorer and got an error Error while look to first emplacement of a scalar numpy array Oct 27, 2018
@PoissonChasseur PoissonChasseur changed the title Error while look to first emplacement of a scalar numpy array Error while look to the first emplacement of a scalar numpy array Oct 27, 2018
@ccordoba12 ccordoba12 added this to the important milestone Oct 27, 2018
@ccordoba12
Copy link
Member

Could you provide an example that doesn't involve steps 1. to 3. but does generate the same error? Thanks!

@PoissonChasseur
Copy link
Author

In fact, I can have the message of error with any Numpy array of only 1 value that will be like

Traceback (most recent call last):

  File "<ipython-input-90-6a1284577a36>", line 1, in <module>
    a[0]

IndexError: too many indices for array

But when I had the error when I opened this problem, even Anaconda said that there was something broken and that I could not install another library after (I tried with " conda install pyopengl "to repair Spyder). I just uninstall Spyder and reinstall it to be sure.

I was not really able after to reproduce the same pattern after.

@ccordoba12 ccordoba12 removed this from the important milestone Oct 27, 2018
@ccordoba12
Copy link
Member

I was not really able after to reproduce the same pattern after.

Ok, thanks for letting us know about it. Closing then.

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

2 participants