Skip to content

Commit

Permalink
Merge pull request numpy#25355 from linus-md/log-docs
Browse files Browse the repository at this point in the history
DOC: Fix typo in ``np.random.default_rng().logistic()``
  • Loading branch information
mattip authored Dec 14, 2023
2 parents 3f19f77 + af69792 commit 2d72bc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/random/_generator.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ cdef class Generator:
-----
The probability density for the Logistic distribution is

.. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},
.. math:: P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},

where :math:`\\mu` = location and :math:`s` = scale.

Expand All @@ -2524,7 +2524,8 @@ cdef class Generator:
Draw samples from the distribution:

>>> loc, scale = 10, 1
>>> s = np.random.default_rng().logistic(loc, scale, 10000)
>>> rng = np.random.default_rng()
>>> s = rng.logistic(loc, scale, 10000)
>>> import matplotlib.pyplot as plt
>>> count, bins, ignored = plt.hist(s, bins=50)

Expand Down

0 comments on commit 2d72bc9

Please sign in to comment.