Search code examples
pythonstatisticssampling

How to write the python raw sampling function to generate a random number using normal distribution?


Where is this source code of python statistics and numpy?

I would like understand how it generate random number from normal distribution

I find school math using probability as a result from table to do sampling topic.

If no category more than 20% probability, it seems can not determine which threshold of probability that can be selected.

Why not use [a, a, b, b, c, c, d, d, e, e] and then random select from a list ?


Solution

  • Where is this source code of python statistics and numpy?

    General way to get where file with source code is located is to print module. For example for numpy.random.rand do

    import numpy
    print(numpy.random)
    

    which will give you full path to .py file for numpy.random.