1import numpy as np
2
3randi_arr = np.random.randint(start, end, dimensions)
4#random integers will be sampled from [start, end) (end not inclusive)
5#end is optional; if end is not specified, random integers will be sampled from [0, start) (start not inclusive)
6#dimensions can be specified as shown here; (m,n) #2D array with size 'm x n'
1>>> np.random.randint(2, size=10)
2array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0]) # random
3>>> np.random.randint(1, size=10)
4array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])