Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread Nathaniel Smith
On Apr 4, 2016 1:58 PM, "mpc" wrote: > > Thanks for responding. > > It looks you made/found these yourself since I can't find anything like this > in the API. I can't believe it isn't, so convenient! > > By the way, from what I understand, the ':' is represented as >

Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread mpc
I think that I do, since I intend to do array specific operations on the resulting column of data. e.g: *PyArray_Min* *PyArray_Max* which require a PyArrayObject argument I also plan to use *PyArray_Where* to find individual point locations in data columns x,y,z within a 3D range, but it

Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread Eric Moore
Yes, PySlice_New(NULL, NULL, NULL) is the same as ':'. Depending on what exactly you want to do with the column once you've extracted it, this may not be the best way to do it. Are you absolutely certain that you actually need a PyArrayObject that points to the column? Eric On Mon, Apr 4,

Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread mpc
Thanks for responding. It looks you made/found these yourself since I can't find anything like this in the API. I can't believe it isn't, so convenient! By the way, from what I understand, the ':' is represented as *PySlice_New(NULL, NULL, NULL) *in the C API when accessing by index, correct?

Re: [Numpy-discussion] rational custom dtype example

2016-04-04 Thread Charles R Harris
On Sat, Apr 2, 2016 at 1:59 PM, Steve Mitchell wrote: > I have noticed a few issues with the “rational” custom C dtype example. > > > > 1.It doesn’t build on Windows. I managed to tweak it to build. > Mainly, the MSVC9 compiler is C89. > > 2. A few tests

Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread Eric Moore
/* obj[ind] */ PyObject* DoIndex(PyObject* obj, int ind) { PyObject *oind, *ret; oind = PyLong_FromLong(ind); if (!oind) { return NULL; } ret = PyObject_GetItem(obj, oind); Py_DECREF(oind); return ret; } /* obj[inds[0], inds[1], ... inds[n_ind-1]] */ PyObject*

[Numpy-discussion] Floor divison on int returns float

2016-04-04 Thread T J
I'm on NumPy 1.10.4 (mkl). >>> np.uint(3) // 2 # 1.0 >>> 3 // 2 # 1 Is this behavior expected? It's certainly not desired from my perspective. If this is not a bug, could someone explain the rationale to me. Thanks. ___ NumPy-Discussion mailing

[Numpy-discussion] Multidimension array access in C via Python API

2016-04-04 Thread mpc
Hello, is there a C-API function for numpy that can implement Python's multidimensional indexing? For example, if I had a 2d array: PyArrayObject * M; and an index int i; how do I extract the i-th row M[i,:] or i-th column M[:,i]? Ideally it would be great if it returned another

Re: [Numpy-discussion] linux wheels coming soon

2016-04-04 Thread G Young
Matthew, you are correct. A lot of things happened with random integer generation recently (including deprecating random_integers), but I believe those warnings should be squashed in the up and coming version of SciPy from what I remember. On Mon, Apr 4, 2016 at 6:47 PM, Matthew Brett

Re: [Numpy-discussion] linux wheels coming soon

2016-04-04 Thread Matthew Brett
Hi, On Mon, Apr 4, 2016 at 9:02 AM, Peter Cock wrote: > On Sun, Apr 3, 2016 at 2:11 AM, Matthew Brett wrote: >> On Fri, Mar 25, 2016 at 6:39 AM, Peter Cock >> wrote: >>> On Fri, Mar 25, 2016 at 3:02 AM, Robert T.

Re: [Numpy-discussion] linux wheels coming soon

2016-04-04 Thread Peter Cock
On Sun, Apr 3, 2016 at 2:11 AM, Matthew Brett wrote: > On Fri, Mar 25, 2016 at 6:39 AM, Peter Cock wrote: >> On Fri, Mar 25, 2016 at 3:02 AM, Robert T. McGibbon >> wrote: >>> I suspect that many of the maintainers of major