cudf.Series.exp#
- Series.exp()#
Get the exponential of all elements, element-wise.
Exponential is the inverse of the log function, so that x.exp().log() = x
- Returns
- DataFrame/Series/Index
Result of the element-wise exponential.
Examples
>>> import cudf >>> ser = cudf.Series([-1, 0, 1, 0.32434, 0.5, -10, 100]) >>> ser 0 -1.00000 1 0.00000 2 1.00000 3 0.32434 4 0.50000 5 -10.00000 6 100.00000 dtype: float64 >>> ser.exp() 0 3.678794e-01 1 1.000000e+00 2 2.718282e+00 3 1.383117e+00 4 1.648721e+00 5 4.539993e-05 6 2.688117e+43 dtype: float64
exp operation on DataFrame:
>>> df = cudf.DataFrame({'first': [-1, -10, 0.5], ... 'second': [0.234, 0.3, 10]}) >>> df first second 0 -1.0 0.234 1 -10.0 0.300 2 0.5 10.000 >>> df.exp() first second 0 0.367879 1.263644 1 0.000045 1.349859 2 1.648721 22026.465795
exp operation on Index:
>>> index = cudf.Index([-1, 0.4, 1, 0, 0.3]) >>> index Float64Index([-1.0, 0.4, 1.0, 0.0, 0.3], dtype='float64') >>> index.exp() Float64Index([0.36787944117144233, 1.4918246976412703, 2.718281828459045, 1.0, 1.3498588075760032], dtype='float64')