Simple addition to random module - Student's t

Mark Dickinson dickinsm at
Wed Sep 2 17:29:52 CEST 2009

On Sep 2, 2:51 pm, Thomas Philips <tkp... at> wrote:
> While the random module allows one to generate randome numbers with a
> variety of distributions, some useful distributions are omitted - the
> Student's t being among them. This distribution is easily derived from
> the normal distribution and the chi-squared distribution (which in
> turn is a special case of the gamma distribution). I edited and tested
> a routine to generate random variables with a Student's t distribution
> that I found on,
> which has  one bug - there is an extra factor of two in y. The
> corrected and tested code follows - how does one go about getting this
> incorporated into random so that the entire community can beneffit
> from it?

To get this into core Python, you'd usually submit a feature request
at  To maximize the chances of the feature
being accepted, provide unit tests and documentation along with the
code.  There's a lot of good information about how the Python
development process works at;  see

Alternatively, you might also consider submitting something to the
Python package index,, or posting this as
a recipe at


More information about the Python-list mailing list