Skip to content
Advertisement

What’s the difference b/w np.random.randint() and np.random.uniform()?

What’s the difference b/w np.random.randint() and np.random.uniform()?

I have gone through the numpy documentation but have not gotten a satisfactory understanding of the difference b/w them, except that the default precision of np.random.uniform() is much greater than the integer values generated by np.random.randint()

Advertisement

Answer

np.random.randint() always returns integer value even when we decide to pick random numbers from a narrow spectrum –

JavaScript

At other end, np.random.uniform() always return a unique number (floating numbers) for the same range.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement