integers#

scikitplot.random.integers(self, low, high=None, size=None, dtype=np.int64, endpoint=False)#

Random integers in [low, high) or [low, high].

Parameters:
lowint

Lowest value (inclusive)

highint, optional

Highest value (exclusive unless endpoint=True)

sizeint or tuple, optional

Output shape

dtypedtype, default=np.int64

Data type

endpointbool, default=False

If True, sample from [low, high] instead of [low, high)

Returns:
int or ndarray

Random integers

Raises:
TypeError

If a bound is not an integer (a Python or numpy integer; bool is refused, as in index).

ValueError

If low >= high, or the range holds more than 2**64 values (more than one 64-bit draw can reach).

Notes

Unbiased (R6-1): a raw draw below 2**64 mod (high - low) is rejected before the modulo. A seeded stream equals the plain modulo’s until the first rejection (probability below (high - low) / 2**64 per draw); every later output is then shifted by one draw.

Examples

>>> gen = KissGenerator(42)
>>> gen.integers(0, 10, size=5)
array([...])