invest some effort if you have an array that does not have the desired memory orderyou can use copy and pass either 'cor ' 'in [ ]arr_f copy(' 'flags out[ ]c_contiguous true f_contiguous false owndata true writeable true aligned true updateifcopy false when constructing view on an arraykeep in mind that the result is not guaranteed to be contiguousin [ ]arr_c[: flags contiguous out[ ]true in [ ]arr_c[:: flags out[ ]c_contiguous false f_contiguous false owndata false writeable true aligned true updateifcopy false other speed optionscythonf pyc in recent yearsthe cython project ((for many scientific python programmers for implementing fast code that may need to interact with or +librariesbut without having to write pure code you can think of cython as python with static types and the ability to interleave functions implemented in into python-like code for examplea simple cython function to sum the elements of one-dimensional array might look likefrom numpy cimport ndarrayfloat _t def sum_elements(ndarray[float _tarr)cdef py_ssize_t in len(arrcdef float _t result for in range( )result +arr[ireturn result cython takes this codetranslates it to cthen compiles the generated code to create python extension cython is an attractive option for performance computing because the code is only slightly more time-consuming to write than pure python code and it integrates closely with numpy common workflow is to get an algorithm working in pythonthen translate it to cython by adding type declarations and handful of other tweaks for moresee the project documentation advanced numpy www it-ebooks info