How to add a column in a panda series that contains the exponential of another column in multiprecision?

27 Views Asked by At

Considering this panda data frame :

df = pd.DataFrame({'x': list(range(-10000, 10001, 1000))})

I would like to insert a column (named exp_x) that contains the exponential of these numbers. Multi precision is needed because some numbers are too large or too low. The gmpy2 library is used (For example : exp(mpfr(5000)) or exp(mpfr(-5000))).

What is the shortest method to do that ?

Thanks for answer.

0

There are 0 best solutions below