Using nditer, is it possible to manually handle dimensions аwith different lengths?а

For example, lets say I had an array A[5, 100] and I wanted to sample every 10 along the second axis so I would end up with an array B[5,10]. Is it possible to do this with nditer, handling the iteration over the second axis manually of course (probably in cython)?

I want something like this (modified fromаhttp://docs.scipy.org/doc/numpy/reference/arrays.nditer.html#putting-the-inner-loop-in-cython)

@cython.boundscheck(False)
def sum_squares_cy(arr):
а а cdef np.ndarray[double] x
а а cdef np.ndarray[double] y
а а cdef int size
а а cdef double value
а а cdef int j

а ааaxeslist = list(arr.shape)
а а axeslist = -1

а а out = zeros((arr.shape, 10))
а а it = np.nditer([arr, out], flags=['reduce_ok', 'external_loop',
а а а а а а а а а а а а а а а а а а а 'buffered', 'delay_bufalloc'],
а а а а а а а а op_axes=[None, axeslist],
а а а а а а а а op_dtypes=['float64', 'float64'])
а а it.operands[...] = 0
а а it.reset()
а а for xarr, yarr in it:
а а а а x = xarr
а а а а y = yarr
а а а а size = x.shape
а а а а j = 0
а а а а for i in range(size):
а а а а а а#some magic here involving indexing into x[i] and y[j]
а а return it.operands

Does this make sense? Is it possible to do?