On Apr 4, 2016 1:58 PM, "mpc" <matt.p.co...@gmail.com> 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
> *PySlice_New(NULL, NULL, NULL) *in the C API when accessing by index,
> correct?
>
>
> Therefore the final result will be something like:
>
> *PyObject* first_column_tuple = PyTuple_New(2);
> PyTuple_SET_ITEM(first_column_tuple, 0, PySlice_New(NULL, NULL, NULL));
> PyTuple_SET_ITEM(first_column_tuple, 1, PyInt_FromLong(0));
> PyObject* first_column_buffer = PyObject_GetItem(src_buffer,
> first_column_tuple);
> *

If this is what your code looks like, then I strongly suspect you'll be
better off writing it in cython or even just plain python. The above code
won't run any faster than the equivalent code in python, but it's much
harder to read and write...

-n
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to