Open In App

sympy.stats.Zeta() in Python

Last Updated : 08 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

With the help of sympy.stats.Zeta() method, we can get the random variable representing the Zeta distribution.

Syntax : sympy.stats.Zeta(name, s)
Return : Return the random variable.

Example #1 :
In this example we can see that by using sympy.stats.Zeta() method, we are able to get the Zeta distribution by using this method.




# Import sympy and Zeta 
from sympy.stats import Zeta, density, E, variance
from sympy import Symbol
  
s = 7
  
# Using sympy.stats.Zeta() method
X = Zeta("x", s)
gfg = density(X)(0.33333)
  
print(gfg)


Output :

2187.15309612378/zeta(7)

Example #2 :




# Import sympy and Zeta 
from sympy.stats import Zeta, density, E, variance
from sympy import Symbol
  
s = 3
z = Symbol("z")
  
# Using sympy.stats.Zeta() method
X = Zeta("x", s)
gfg = density(X)(z)
  
print(gfg)


Output :

1/(z**3*zeta(3))


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads