@@ -3609,7 +3609,7 @@ cdef class RandomState:
36093609 `a` > 1.
36103610
36113611 The Zipf distribution (also known as the zeta distribution) is a
3612- continuous probability distribution that satisfies Zipf's law: the
3612+ discrete probability distribution that satisfies Zipf's law: the
36133613 frequency of an item is inversely proportional to its rank in a
36143614 frequency table.
36153615
@@ -3642,9 +3642,10 @@ cdef class RandomState:
36423642 -----
36433643 The probability density for the Zipf distribution is
36443644
3645- .. math:: p(x ) = \\ frac{x ^{-a}}{\\ zeta(a)},
3645+ .. math:: p(k ) = \\ frac{k ^{-a}}{\\ zeta(a)},
36463646
3647- where :math:`\\ zeta` is the Riemann Zeta function.
3647+ for integers ``k`` >= 1, where :math:`\\ zeta` is the Riemann Zeta
3648+ function.
36483649
36493650 It is named for the American linguist George Kingsley Zipf, who noted
36503651 that the frequency of any word in a sample of a language is inversely
@@ -3674,10 +3675,10 @@ cdef class RandomState:
36743675 `bincount` provides a fast histogram for small integers.
36753676
36763677 >>> count = np.bincount(s)
3677- >>> x = np.arange(1, s.max() + 1)
3678+ >>> k = np.arange(1, s.max() + 1)
36783679
3679- >>> plt.bar(x , count[1:], alpha=0.5, label='sample count')
3680- >>> plt.plot(x , n*(x **-a)/zeta(a), 'k.-', alpha=0.5,
3680+ >>> plt.bar(k , count[1:], alpha=0.5, label='sample count')
3681+ >>> plt.plot(k , n*(k **-a)/zeta(a), 'k.-', alpha=0.5,
36813682 ... label='expected count') # doctest: +SKIP
36823683 >>> plt.semilogy()
36833684 >>> plt.grid(alpha=0.4)
0 commit comments