[SciPy-user] Why doesn't norm_gen have a 'dist' attribute?
Armando Serrano Lombillo
Fri Sep 12 07:09:32 CDT 2008
Hello Michael. norm_gen is not meant to be used, it is just used inside
scipy's code to generate the norm class, which you should use.
from scipy.stats import norm
d = norm(loc=mean)
or whatever you need to do.
Hope it helps,
On Fri, Sep 12, 2008 at 1:02 PM, Michael <firstname.lastname@example.org> wrote:
> > Message: 2
> > Date: Wed, 10 Sep 2008 23:05:30 -0500
> > From: "Robert Kern" <email@example.com>
> > Subject: Re: [SciPy-user] examples of using norm_gen
> > To: "SciPy Users List" <firstname.lastname@example.org>
> > Message-ID:
> > <email@example.com>
> > Content-Type: text/plain; charset=UTF-8
> > On Wed, Sep 10, 2008 at 19:41, SimonPalmer <firstname.lastname@example.org>
> > > can anyone point me in the direction of examples of how to use norm/
> > > norm_gen from the scipy.stats.distributions module?
> > The docstring gives a good overview of its capabilities. Is there
> > something specific you found confusing or inadequate about it?
> norm_gen doesn't appear to _generate_ anything, not directly anyway
> a=d.norm_gen(name='norm',longname='a normal')
> a is <class 'scipy.stats.distributions.norm_gen'>
> b is <class 'scipy.stats.distributions.rv_frozen'>
> both a and b produce normal distributions that don't 'look' normal - see
> attached, though this is a bad test since the beta distribution looks
> totally mangled but is correc
> Leaving norm_gen aside for a moment, c.f. the lack of the 'dist'
> attribute in 'a', one might also ask: what the dist attribute does?
> Where did it spring from? there's too much padding in the scipy
> sandwich, so to speak;
> e.g. the sheer number of ways of creating scipy distributions is
> slightly baffling; afaik norm_gen is a base class that is not to be used
> directly... but that's just a guess.
> That said, there is an 85-100 fold speed-up over using a np.random
> distribution + np.histogram
> Is there a guide somewhere explaining how scientific python api's are
> packaged/structured? import idioms?
> > --
> > Robert Kern
> > "I have come to believe that the whole world is an enigma, a harmless
> > enigma that is made terrible by our own mad attempt to interpret it as
> > though it had an underlying truth."
> > -- Umberto Eco
> SciPy-user mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-user