bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _distribution_infrastructure / exp
function
scipy.stats._distribution_infrastructure:exp
source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_distribution_infrastructure.py:5735
Signature
def exp(X, /)Summary
Natural exponential of a random variable.
Parameters
X: `ContinuousDistribution`The random variable .
Returns
Y: `ContinuousDistribution`A random variable .
Examples
Suppose we have a normally distributed random variable :math:`X`:import numpy as np from scipy import stats X = stats.Normal()✓
Y = stats.exp(X)
✓import matplotlib.pyplot as plt rng = np.random.default_rng(435383595582522) y = Y.sample(shape=10000, rng=rng) ax = plt.gca()✓
ax.hist(np.log(y), bins=50, density=True) X.plot(ax=ax) plt.legend(('PDF of `X`', 'histogram of `log(y)`'))✗
<matplotlib.legend.Legend object at 0x7f3f68cd0590>
plt.show()
✓
Aliases
scipy.stats.exp