How can this function be faster? Solving for a row of Pascal's triangle
You can memoize the rows you have already computed previously.  

Alternatively, you could compute it in closed form using the binomial coefficients:



Start looking in scipy.special.binom.