Wednesday, May 6, 2026
HomeLanguagessympy.stats.Zeta() in Python

sympy.stats.Zeta() in Python

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))

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6890 POSTS0 COMMENTS
Nicole Veronica
12011 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12105 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS