8000 DOC: clarify numpy.random docstring. · rkern/numpy@b369381 · GitHub
[go: up one dir, main page]

Skip to content

Commit b369381

Browse files
committed
DOC: clarify numpy.random docstring.
1 parent 251d290 commit b369381

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

numpy/random/__init__.py

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,42 @@
33
Random Number Generation
44
========================
55
6-
Instantiate a BitGenerator and wrap it in a Generator
7-
which will convert the uniform stream to a number of distributions. The "bare"
8-
functions are kept for legacy code, they should be called with the newer API
9-
via ``np.random.Generator().function`` instead
6+
Use ``default_gen()`` to create a `Generator` and call its methods.
7+
8+
=============== =========================================================
9+
Generator
10+
--------------- ---------------------------------------------------------
11+
Generator Class implementing all of the random number distributions
12+
default_gen Default constructor for ``Generator``
13+
=============== =========================================================
14+
15+
============================================= ===
16+
BitGenerator Streams that work with Generator
17+
--------------------------------------------- ---
18+
MT19937
19+
PCG64
20+
Philox
21+
SFC64
22+
============================================= ===
23+
24+
============================================= ===
25+
Getting entropy to initialize a BitGenerator
26+
--------------------------------------------- ---
27+
SeedSequence
28+
============================================= ===
29+
30+
31+
Legacy
32+
------
33+
34+
For backwards compatibility with previous versions of numpy before 1.17, the
35+
various aliases to the global `RandomState` methods are left alone and do not
36+
use the new `Generator` API.
1037
1138
==================== =========================================================
1239
Utility functions
1340
-------------------- ---------------------------------------------------------
1441
random Uniformly distributed floats over ``[0, 1)``
15-
integers Uniformly distributed integers, replaces ``randint``
1642
bytes Uniformly distributed random bytes.
1743
permutation Randomly permute a sequence / generate a random sequence.
1844
shuffle Randomly permute a sequence in place.
@@ -94,20 +120,6 @@
94120
set_state Set state of generator.
95121
==================== =========================================================
96122
97-
============================================= ===
98-
BitGenerator Streams that work with Generator
99-
--------------------------------------------- ---
100-
MT19937
101-
PCG64
102-
Philox
103-
SFC64
104-
============================================= ===
105-
106-
============================================= ===
107-
Getting entropy to initialize a BitGenerator
108-
--------------------------------------------- ---
109-
SeedSequence
110-
============================================= ===
111123
112124
"""
113125
from __future__ import division, absolute_import, print_function

0 commit comments

Comments
 (0)
0