random_integers(self, low, high=None, size=None, chunks='auto', **kwargs)
This docstring was copied from numpy.random.mtrand.RandomState.random_integers.
Some inconsistencies with the Dask version may exist.
Return random integers of type :None:None:`np.int_`
from the "discrete uniform" distribution in the closed interval [`low`, :None:None:`high`
]. If :None:None:`high`
is None (the default), then results are from [1, :None:None:`low`
]. The :None:None:`np.int_`
type translates to the C long integer type and its precision is platform dependent.
This function has been deprecated. Use randint instead.
To sample from N evenly spaced floating-point numbers between a and b, use:
a + (b - a) * (np.random.random_integers(N) - 1) / (N - 1.)
Lowest (signed) integer to be drawn from the distribution (unless high=None
, in which case this parameter is the highest such integer).
If provided, the largest (signed) integer to be drawn from the distribution (see above for behavior if high=None
).
Output shape. If the given shape is, e.g., (m, n, k)
, then m * n * k
samples are drawn. Default is None, in which case a single value is returned.
:None:None:`size`
-shaped array of random integers from the appropriate distribution, or a single such random int if :None:None:`size`
not provided.
Random integers of type :None:None:`np.int_`
between :None:None:`low`
and :None:None:`high`
, inclusive.
randint
Similar to :None:None:`random_integers`
, only for the half-open interval [`low`, :None:None:`high`
), and 0 is the lowest value if :None:None:`high`
is omitted.
>>> np.random.random_integers(5) # doctest: +SKIP 4 # randomThis example is valid syntax, but we were not able to check execution
>>> type(np.random.random_integers(5)) # doctest: +SKIP <class 'numpy.int64'>This example is valid syntax, but we were not able to check execution
>>> np.random.random_integers(5, size=(3,2)) # doctest: +SKIP array([[5, 4], # random [3, 3], [4, 5]])
Choose five random numbers from the set of five evenly-spaced numbers between 0 and 2.5, inclusive (i.e., from the set ${0, 5/8, 10/8, 15/8, 20/8}$ ):
This example is valid syntax, but we were not able to check execution>>> 2.5 * (np.random.random_integers(5, size=(5,)) - 1) / 4. # doctest: +SKIP array([ 0.625, 1.25 , 0.625, 0.625, 2.5 ]) # random
Roll two six sided dice 1000 times and sum the results:
This example is valid syntax, but we were not able to check execution>>> d1 = np.random.random_integers(1, 6, 1000) # doctest: +SKIP
... d2 = np.random.random_integers(1, 6, 1000) # doctest: +SKIP
... dsums = d1 + d2 # doctest: +SKIP
Display results as a histogram:
This example is valid syntax, but we were not able to check execution>>> import matplotlib.pyplot as plt # doctest: +SKIPSee :
... count, bins, ignored = plt.hist(dsums, 11, density=True) # doctest: +SKIP
... plt.show() # doctest: +SKIP
The following pages refer to to this document either explicitly or contain code examples using this.
dask.array.random.RandomState.tomaxint
dask.array.random.RandomState.randint
dask.array.random.RandomState.uniform
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them