-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
If I try and read in the array contained in this npy file:
then try and print out the array, so:
import numpy as np
array = np.load('test.npy')
print(array)
I get:
Traceback (most recent call last):
File "test2.py", line 5, in <module>
print(array)
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/numeric.py", line 1767, in array_str
return array2string(a, max_line_width, precision, suppress_small, ' ', "", str)
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/arrayprint.py", line 459, in array2string
separator, prefix, formatter=formatter)
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/arrayprint.py", line 329, in _array2string
_summaryEdgeItems, summary_insert)[:-1]
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/arrayprint.py", line 526, in _formatArray
s += _formatArray(a[-i], format_function, rank-1, max_line_len,
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/records.py", line 481, in __getitem__
return obj.view(dtype=(self.dtype.type, obj.dtype.descr))
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/records.py", line 540, in view
return ndarray.view(self, dtype)
File "/Volumes/Raptor/miniconda3/envs/dev/lib/python3.4/site-packages/numpy/core/records.py", line 457, in __setattr__
raise exctype(value)
TypeError: Cannot change data-type for object array.
This is with the latest developer version of Numpy (3c5409e) and Python 3.4 on MacOS X.
The dtype can be printed, as can individual columns, but the array as a whole can't. This doesn't occur in the latest stable release so may be a regression?