[SciPy-Dev] scipy.stats.signaltonoise docstring
Tue Jun 15 01:00:25 CDT 2010
On Mon, Jun 14, 2010 at 10:52 PM, Robert Kern <email@example.com> wrote:
> On Tue, Jun 15, 2010 at 00:47, David Goldsmith <firstname.lastname@example.org>
> > Hi, folks! The docstring for scipy.stats.stats.signaltonoise says that
> > axis == None, the input is first ravel'd, but I see no code that does
> > here's the code:
> > def signaltonoise(a, axis=0, ddof=0):
> > """..."""
> > a = np.asanyarray(a)
> > m = a.mean(axis)
> > sd = a.std(axis=axis, ddof=ddof)
> > return np.where(sd == 0, 0, m/sd)
> > Even though it's not surrounded by an "if axis is None:", I checked the
> > docstring for asanyarray anyway, and there's nothing there about
> > raveling. So, what gives?
> axis=None also ravels for the .mean() and .std() methods. Since the
> rest of the function doesn't touch the input except through the
> results of those methods, the function as a whole treats axis=None as
> Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev