With the help of sympy.stats.Levy() method, we can get the continuous random variable which represents the levy distribution.
Syntax :
sympy.stats.Levy(name, mu, c)
Where, mu and c are real number and mu, c > 0.
Return : Return the continuous random variable.
Example #1 :
In this example we can see that by using sympy.stats.Levy() method, we are able to get the continuous random variable representing levy distribution by using this method.
| # Import sympy and Levy fromsympy.stats importLevy, density fromsympy importSymbol, pprint  Âz =Symbol("z") mu =Symbol("mu", positive =True) c =Symbol("c", positive =True)  Â# Using sympy.stats.Levy() method X =Levy("x", mu, c) gfg =density(X)(z)  Âpprint(gfg)  | 
Output :
sqrt(2)*sqrt(c)*exp(-c/(-2*mu + 2*z))/(2*sqrt(pi)*(-mu + z)**(3/2))
Example #2 :
| # Import sympy and Levy fromsympy.stats importLevy, density fromsympy importSymbol, pprint  Âz =0.3mu =3c =2 Â# Using sympy.stats.Levy() method X =Levy("x", mu, c) gfg =density(X)(z)  Âpprint(gfg)  | 
Output :
0.014240812169263

 
                                    








