You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / 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, optional

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.

Returns

out : ndarray

Drawn 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