For those who will read this question, the answer was provided by sega_sai , in the comments of my question. The trick was to make sure that the array is C contiguous. To do so, you can either use the option "order = 'C' " when creating the array, for instance:
a = np.array([1,2,3,4],order='C')
(for more information see numpy reference: http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html) or transform it as a c contiguous array by doing:
np.ascontiguousarray(a)
(for mor information see numpy reference http://docs.scipy.org/doc/numpy/reference/generated/numpy.ascontiguousarray.html)