On Tue, 5 Apr 2016 08:39:39 -0700 (MST) mpc <matt.p.co...@gmail.com> wrote: > This is the reason I'm doing this in the first place, because I made a pure > python version but it runs really slow for larger data sets, so I'm > basically rewriting the same function but using the Python and Numpy C API, > but if you're saying it won't run any faster then maybe I'm going at it the > wrong way. (Why use the C function version if it's the same speed anyway?)
The Python and Numpy C API are generally not very user-friendly compared to Python code, even hand-optimized. Cython will let you write code that looks quite close to normal Python code, but with additional annotations for better performance. Or you can try Numba, a just-in-time compiler for scientific code that understand Numpy arrays: http://numba.pydata.org/ Regards Antoine. _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion