You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Trying to create an numpy array with a zero sized dtype
importnumpynumpy.frombuffer(b'',dtype='S')
raises
ValueError: itemsizecannotbezerointype
(Version: numpy==1.15.1, python 3.7.0b3)
This comes from a check in the PyArray_FromBuffer method in ctors.c
if (PyDataType_ISUNSIZED(type)) {
PyErr_SetString(PyExc_ValueError,
"itemsize cannot be zero in type");
Py_DECREF(type);
returnNULL;
}
Issue #3926 was facing a similar problem: it couldn't pickle-depickle empty-strings, due to a similar check, and was adressed by removing the check on the size (PR #5475)
My opinion is that we can produce a similar solution, but I am waiting for senior contributors to weigh in on that.
Related: PR #12011 that uses frombuffer to reconstruct serialized arrays.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Trying to create an numpy array with a zero sized dtype
raises
(Version:
numpy==1.15.1
,python 3.7.0b3
)This comes from a check in the
PyArray_FromBuffer
method inctors.c
Issue #3926 was facing a similar problem: it couldn't pickle-depickle empty-strings, due to a similar check, and was adressed by removing the check on the size (PR #5475)
My opinion is that we can produce a similar solution, but I am waiting for senior contributors to weigh in on that.
Related: PR #12011 that uses
frombuffer
to reconstruct serialized arrays.Pinging @ogrisel
The text was updated successfully, but these errors were encountered: