[SciPy-User] scipy.stats example code with numargs

Skipper Seabold jsseabold@gmail....
Fri Jan 6 11:16:58 CST 2012


On Fri, Jan 6, 2012 at 12:12 PM, Henry Harpending <harpend@gmail.com> wrote:
> Examples of the use of distributions in scipy documentation start with with
> something like this:
>
>>>> from scipy.stats import truncnorm
>>>> numargs = truncnorm.numargs
>>>> [ a, b ] = [0.9,] * numargs
>>>> rv = truncnorm(a, b)
>
>
> What does this do?  Why 0.9?  In this particular case it seems to make no
> sense: the standard normal truncated between 0.9 and 0.9.  Or am I way off
> base?
>

I believe that all the distribution documentation is based off a
template, and there are a few cases where it doesn't make any sense.
Your understanding is correct. That doesn't make any sense, and will
actually raise an error if you try to sample from rv.

Skipper


More information about the SciPy-User mailing list