top of page

Machine Learning

Public·3 members

Numpy Distributions

Generate random int from 0 up to N


import numpy as np

# generate a single int from 0 to 100 (exclusive)
np.random.randint(0,100)
# >>> 56

# generate 5 random ints from 0 to 100 (exclusive)
np.random.randint(0,100, size=5)
# >>> [29,52,89,9,22,3]

28 Views
sehally44
Aug 04, 2021

Good to know that.

bottom of page