On Aug 6, 2009, at 12:22 PM, Keith Goodman wrote: > On Thu, Aug 6, 2009 at 9:18 AM, Robert Kern<robert.k...@gmail.com> > wrote: >> On Thu, Aug 6, 2009 at 11:15, Keith Goodman<kwgood...@gmail.com> >> wrote: >>> thanksOn Thu, Aug 6, 2009 at 9:07 AM, Robert Kern<robert.k...@gmail.com >>> > wrote: >>>> On Thu, Aug 6, 2009 at 11:03, Keith Goodman<kwgood...@gmail.com> >>>> wrote: >> >>>>>>> pylab.demean?? >>>>> Type: function >>>>> Base Class: <type 'function'> >>>>> String Form: <function demean at 0x3c5c050> >>>>> Namespace: Interactive >>>>> File: /usr/lib/python2.6/dist-packages/matplotlib/ >>>>> mlab.py >>>>> Definition: pylab.demean(x, axis=0) >>>>> Source: >>>>> def demean(x, axis=0): >>>>> "Return x minus its mean along the specified axis" >>>>> x = np.asarray(x) >>>>> if axis: >>>>> ind = [slice(None)] * axis >>>>> ind.append(np.newaxis) >>>>> return x - x.mean(axis)[ind] >>>>> return x - x.mean(axis)
FYI, there's a "anom" method for MaskedArrays that does the same thing as demean (if you can't /don't want to import mpl) _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion