Timeline for Python Numpy - cannot get array to save/load properly
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 11, 2019 at 16:27 | comment | added | Serendipity | I had the same problem with numpy 1.17. This is not an explanation of the error's root cause nor a solution, but rather a workaround - downgrade numpy to 1.16.2. e.g., 'pip install -U numpy=1.16.2' or 'conda install numpy=1.16.2' fixed the problem for me, | |
| Oct 1, 2019 at 16:46 | comment | added | hpaulj |
It's likely that your array is object dtype. np.zeros is a float dtype. Object dtype arrays have to use pickle to save the object elements. In newer numpy versions, you have to explicitly allow_pickle when loading such an array. This is meant to improve security.
|
|
| Oct 1, 2019 at 10:25 | review | Close votes | |||
| Oct 5, 2019 at 0:00 | |||||
| Oct 1, 2019 at 10:09 | comment | added | zvone | Possible duplicate of How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function? | |
| Oct 1, 2019 at 10:09 | answer | added | Mathieu | timeline score: 3 | |
| Oct 1, 2019 at 10:06 | comment | added | Sayandip Dutta |
Are you sure the variable array in your code is an array and not a list? If it's an array, check it's dtype (array.dtype), if it's an object array convert it to float or int (array.astype('float32'))
|
|
| S Oct 1, 2019 at 10:03 | review | Triage | |||
| Oct 1, 2019 at 10:14 | |||||
| S Oct 1, 2019 at 10:03 | history | asked | ASG | CC BY-SA 4.0 |