there is a bug in PyArray_CheckFromAny ?
10 Mar
2009
10 Mar
'09
5:48 a.m.
Hi, if o is a "vector" <numpy.ndarray of shape (n,)> and <dtype=int32>, the following lines: po = PyArray_CheckFromAny(o,PyArray_DescrFromType(NPY_INT),0,0, NPY_FORCECAST|NPY_OUT_FARRAY|NPY_ELEMENTSTRIDES,NULL); int *ver = (int *)((PyArrayObject *)po)->data; printf("0: %d\n",ver[0]); printf("1: %d\n",ver[1]); show that: 0: 0 1: -1 regardless of the value (size>2). But if I modify the shape of "o" before the previous line, for example shape = (1,n), works fine! Regards, Luis. PD: In debian squeeze: $ dpkg -s python-numpy |grep Version Version: 1:1.2.1-1 Python-Version: 2.4, 2.5
5770
Age (days ago)
5770
Last active (days ago)
0 comments
1 participants
participants (1)
-
Luis Saavedra