In SciPy one can implement a beta distribution as follows:
x=640495496
alpha=1.5017096
beta=628.110247
A=0
B=148000000000
p = scipy.stats.beta.cdf(x, alpha, beta, loc=A, scale=B-A)
Now, suppose I have a Pandas dataframe with the columns x,alpha,beta,A,B. How do I apply the beta distribution to each row, appending the result as a new column?
Given that I suspect that pandas apply is just looping over all rows, and the scipy.stats distributions have quite a bit of overhead in each call, I would use a vectorized version: