[IPython-user] help on help

John Hunter jdh2358@gmail....
Sun Mar 4 15:30:54 CST 2007


In ipython (svn), when I do "help scipy.stats.norm" I get a very
unhelpful message (the same one I get in python actually).  When I do
"scipy.stats.norm?", however, I get the expected helpful output.

What is the difference, and why is the normal "help" for this
particular object so impoverished in ipython and python where as the
"?" query is so useful?

In [152]: IPython.__version__
Out[152]: '0.7.4.svn.r2120'

In [158]: import scipy.stats

In [159]: help scipy.stats.norm
--------> help(scipy.stats.norm)
Help on norm_gen in module scipy.stats.distributions:

<scipy.stats.distributions.norm_gen object at 0x5748f30>

In [161]: scipy.stats.norm?
Type:           norm_gen
Base Class:     <class 'scipy.stats.distributions.norm_gen'>
String Form:    <scipy.stats.distributions.norm_gen object at 0x5748f30>
Namespace:      Interactive
Docstring:
    A normal continuous random variable.

        Continuous random variables are defined from a standard form chosen
        for simplicity of representation.  The standard form may require
        some shape parameters to complete its specification.  The distributions
        also take optional location and scale parameters using loc= and scale=
        keywords (defaults: loc=0, scale=1)

        These shape, scale, and location parameters can be passed to any of the
        methods of the RV object such as the following:

        norm.rvs(loc=0,scale=1)
            - random variates

        norm.pdf(x,loc=0,scale=1)
            - probability density function

        norm.cdf(x,loc=0,scale=1)
            - cumulative density function

        norm.sf(x,loc=0,scale=1)
            - survival function (1-cdf --- sometimes more accurate)

        norm.ppf(q,loc=0,scale=1)
            - percent point function (inverse of cdf --- percentiles)

        norm.isf(q,loc=0,scale=1)
            - inverse survival function (inverse of sf)

        norm.stats(loc=0,scale=1,moments='mv')
            - mean('m',axis=0), variance('v'), skew('s'), and/or kurtosis('k')

        norm.entropy(loc=0,scale=1)
            - (differential) entropy of the RV.

        Alternatively, the object may be called (as a function) to fix
           the shape, location, and scale parameters returning a
           "frozen" continuous RV object:

        myrv = norm(loc=0,scale=1)
            - frozen RV object with the same methods but holding the
                given shape, location, and scale fixed


    Normal distribution

    The location (loc) keyword specifies the mean.
    The scale (scale) keyword specifies the standard deviation.

    normal.pdf(x) = exp(-x**2/2)/sqrt(2*pi)


More information about the IPython-user mailing list