pandas - return column of exponential values
Well math.exp
doesn't understand Series
datatype, use numpy np.exp
which does and is vectorised so operates on the entire column:
In [24]:
df['exp'] = np.exp(df['b'])
df
Out[24]:
a b exp
0 0 0.71 2.033991
1 1 0.75 2.117000
2 2 0.80 2.225541
3 3 0.90 2.459603