Closed
Description
Am I, mr user, supposed to call npyinitialize()
? I'm guessing not, so this might be a bug.
Seems asscalar
, and in turn convert(Int, numpy_array_element::PyObject)
, depends on npy_number
being initialized
using PyCall
@pyimport numpy as np
pyoarr = pycall(np.array, PyObject, 1:3)
el = get(pyoarr, PyObject, 0)
@show pytypeof(el) pytypeof(PyCall.asscalar(el)) PyCall.npy_number
convert(Int, el)
outputs
pytypeof(el) = PyObject <class 'numpy.int64'>
pytypeof(PyCall.asscalar(el)) = PyObject <class 'numpy.int64'> (should be int)
PyCall.npy_number = PyObject NULL (shouldn't be null for asscalar to work)
ERROR: PyError (ccall(@pysym(PyInt_AsSsize_t), Int, (PyPtr,), asscalar(po))) <class 'TypeError'>
TypeError('an integer is required',)
Metadata
Metadata
Assignees
Labels
No labels