0

Can anyone please guide how to create Numpy array with predeifined Standard deviation and mean. For example mean should be 75 and std should be 12

Rushabh Shah
  • 75
  • 1
  • 2
  • 14
  • Maybe this will help? https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.normal.html –  Dec 25 '19 at 08:01
  • Try this https://stackoverflow.com/questions/50177594/create-an-array-with-a-pre-determined-mean-and-standard-deviation – k92 Dec 25 '19 at 08:02

1 Answers1

1

See https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.normal.html

in short, you can use

numpy.random.normal([mean], [standard deviation], [array size])

so for your example:

numpy.random.normal(75, 12, [array size])
shayelk
  • 1,606
  • 1
  • 14
  • 32
  • Hello! How to Generate numbers with all positive numbers? – Megan Jun 28 '22 at 07:06
  • @Megan, you can't- not with normal distribution. look here for a more thorough explanation: https://stackoverflow.com/questions/1683461/generating-a-gaussian-distribution-with-only-positive-numbers – shayelk Jun 29 '22 at 08:10