I am considering switching from MATLAB to Python. The core of my MATLAB code repeatedly calls erf on an array of a few thousand numbers, like:
r=rand(1,1e5)
erf(r)
This is my implementation in Python:
import numpy as np
import scipy.special as sps
r=np.random.rand(1e5)
sps.erf(r)
The Python version takes about three times as long. If I use Cython to compile just this core of the program, will I see a major speedup? I have very little Python experience, and no C experience, so I thought I'd check here before trying to figure out Cython.