Error when attempting to inspect array with special dtype
See original GitHub issueProblem Description
What steps will reproduce the problem?
Created np.dtype, assigned np.dtype to array. Attempted to open array from variable explorer and got "Spyder has encountered an internal problem.
Traceback
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\collectionseditor.py", line 470, in createEditor
if not editor.setup_and_check(value, title=key, readonly=readonly):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 660, in setup_and_check
readonly, xlabels, ylabels))
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 541, in __init__
ylabels=ylabels, readonly=readonly, parent=self)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\site-packages\spyder\widgets\variableexplorer\arrayeditor.py", line 131, in __init__
self.test_array = np.array([0], dtype=data.dtype)
ValueError: Converting an integer to a NumPy datetime requires a specified unit
Package Versions
- Spyder version: 3.2.8
- Python version: 3.6.5
- Qt version: 5.9.4
- PyQt5 version: 5.9.2
- Operating system: Windows 10
Dependencies
pyflakes >=0.6.0 : 1.6.0 (OK)
pycodestyle >=2.3: 2.4.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pandas >=0.13.1 : 0.23.0 (OK)
numpy >=1.7 : 1.14.3 (OK)
sphinx >=0.6.6 : 1.7.4 (OK)
rope >=0.9.4 : 0.10.7 (OK)
jedi >=0.9.0 : 0.12.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
cython >=0.21 : 0.28.2 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
IPython >=4.0 : 6.4.0 (OK)
pylint >=0.25 : 1.8.4 (OK)
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Numpy Array using Dtypes Throwing Error - python
I am doing something fairly simple, I'm trying to convert a list of lists to an np.array ...
Read more >NumPy - Array filled with specific value
(3) Creating NumPy array with all its elements values as a specific given value ... my_zeroes_array=np.zeros(tup_dim,dtype=np.int16) print(my_zeroes_array).
Read more >pandas.api.extensions.ExtensionArray
pandas will recognize instances of this class as proper arrays with a custom type and will not attempt to coerce them to objects....
Read more >Array creation — NumPy v1.24 Manual
If you expect your integer arrays to be a specific type, then you need to specify the dtype while you create the array....
Read more >Cython for NumPy users
import numpy as np # We now need to fix a datatype for our arrays. I've used the variable # DTYPE for this,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for referring me to #8582. I already updated everything but nothing worked out. Just had to downgrade my numpy version to 1.15.0. It may be useful for someone else in the future.
@lalita90 You don’t have this bug. You have #8582, which is fixed in 3.3.3. To fix it please upgrade to the latest version of Spyder by opening the Anaconda Prompt and typing: