How to create RANDOM Numbers in Python?
0

How to create RANDOM Numbers in Python?

This recipe helps you create RANDOM Numbers in Python
In [1]:
## How to create RANDOM Numbers in Python
def Kickstarter_Example_60():
    print()
    print(format('How to create RANDOM Numbers in Python','*^82'))

    import warnings
    warnings.filterwarnings("ignore")

    # Load Libraries
    import numpy as np

    # Generate A Random Number From The Normal Distribution
    print(); print(np.random.normal())

    # Generate Four Random Numbers From The Normal Distribution
    print(); print(np.random.normal(size=14))

    # Generate Four Random Numbers From The Uniform Distribution
    print(); print(np.random.uniform(size=14))

    # Generate Four Random Integers Between 1 and 100
    print(); print(np.random.randint(low=1, high=100, size=14))

Kickstarter_Example_60()
**********************How to create RANDOM Numbers in Python**********************

0.5718079692879499

[-0.61879245  0.65817166 -0.41865909 -0.94647033 -0.01689476 -0.47632777
  1.2639386  -0.11208773  0.14831378  0.84344252  1.22783882  1.0624572
 -0.71145307 -0.24354584]

[0.66456188 0.86262981 0.8608813  0.40233827 0.07954986 0.2030632
 0.37323321 0.28267457 0.67675625 0.10700224 0.89255879 0.38690977
 0.66770101 0.16143554]

[ 4 99 10 66 28 81 22  5 36 25 28 92 39 93]