What is the rule to determine the dtype returned by numpy functions
that return indices such as np.argmax?

I assumed that np.argmax() returned the same dtype as np.int_. That
works on linux32/64 and win32 but on win-amd64 np.int_ is int32 and
np.argmax() returns int64.

Someone suggested using intp. But I can't figure out how to do that in
Cython since I am unable to cimport NPY_INTP. So this doesn't work:

from numpy cimport NPY_INTP
cdef np.ndarray[np.intp_t, ndim=1] output = PyArray_EMPTY(1, dims, NPY_INTP, 0)

Is there another way? All I can think of is checking whether np.intp
is np.int32 or int64 when I template the code.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to