Example 1: generate random integer matrix python
import numpy as np
randi_arr = np.random.randint(start, end, dimensions)
Example 2: python randint
from random import randint
print(randint(3, 9))
Example 3: python randint
from random import randint
print(randint(3, 9))
Example 4: numpy randint
>>> np.random.randint(2, size=10)
array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])
>>> np.random.randint(1, size=10)
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Example 5: np.rand.randint
np.random.randint(0,10, size=(5, 5))
array([[3, 9, 2, 3, 5],
[2, 8, 7, 7, 1],
[8, 2, 1, 1, 9],
[9, 0, 5, 6, 4],
[1, 6, 6, 4, 6]])
Example 6: python randint
from random import randint
print(randint(1,2))