sympy.stats.Exponential() in python
Last Updated :
05 Jun, 2020
With the help of sympy.stats.Exponential()
method, we can get the continuous random variable representing the exponential distribution.
Syntax : sympy.stats.Exponential(name, rate)
Return : Return continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.Exponential()
method, we are able to get the continuous random variable which represents the Exponential distribution by using this method.
from sympy.stats import Exponential, density
from sympy import Symbol
rate = Symbol( "rate" , integer = True , positive = True )
z = Symbol( "z" )
X = Exponential( "x" , rate)
gfg = density(X)(z)
pprint(gfg)
|
Output :
-rate*z
rate*e
Example #2 :
from sympy.stats import Exponential, density
from sympy import Symbol
rate = 5
z = 0.5
X = Exponential( "x" , rate)
gfg = density(X)(z)
pprint(gfg)
|
Output :
0.410424993119494
Share your thoughts in the comments
Please Login to comment...