Random integers

Date: March 2nd 2016
Last updated: March 2nd 2016

numpy.random.randint returns integers from low (inclusive) to high (not included) and optionally return multiple values.

Default

import numpy as np
np.random.randint(10)
9

Numbers from low to high value

np.random.randint(10, 20)
16

Return multiple numbers

np.random.randint(10, 20, size=5)
#array([17, 11, 11, 10, 18])

results matching ""

    No results matching ""