bundles / numpy latest / numpy / random / mtrand / RandomState / tomaxint
cython_function_or_method
numpy.random.mtrand:RandomState.tomaxint
Signature
def tomaxint ( size = None ) Summary
Return a sample of uniformly distributed random integers in the interval [0, np.iinfo("long").max].
Extended Summary
Parameters
size: int or tuple of ints, optionalOutput shape. If the given shape is, e.g.,
(m, n, k), thenm * n * ksamples are drawn. Default is None, in which case a single value is returned.
Returns
out: ndarrayDrawn samples, with shape
size.
Examples
rs = np.random.RandomState() # need a RandomState object
✓rs.tomaxint((2,2,2)) rs.tomaxint((2,2,2)) < np.iinfo(np.int_).max✗
See also
- randint
Uniform sampling over a given half-open interval of integers.
- random_integers
Uniform sampling over a given closed interval of integers.
Aliases
-
numpy.random.RandomState.tomaxint