[Numpy-discussion] the mean, var, std of non-arrays

Charles R Harris charlesr.harris at gmail.com
Fri Jul 19 00:12:45 EDT 2013


On Thu, Jul 18, 2013 at 9:24 PM, Yaroslav Halchenko <lists at onerussian.com>wrote:

>
> On Thu, 18 Jul 2013, Skipper Seabold wrote:
>
> >      Not sure anyways if my direct numpy.mean application to pandas
> DataFrame
> >      is
> >      "kosher" -- initially I just assumed that any argument is
> asanyarray'ed
> >      first
> >      -- but I think here catching TypeError for those incompatible
> .mean's
> >      would not
> >      hurt either. �What do you think? �Similar logic applies to mean
> cousins
> >      (var,
> >      std, ...?) decorated around _methods implementations.
>
> >    Related? From a while ago.
> >    [3]https://github.com/numpy/numpy/pull/160
>
> yeah...  That is how I thought "it is working", but I guess it was left
> without asanyarraying for additional flexibility/performance so any
> array-like object could be used, not just ndarray derived classes.
>

Speaking of which, there is a PR for nan{mean, var,
std)<https://github.com/numpy/numpy/pull/3534>
that you might want to check before it gets committed. There might be some
modifications that you would want to add.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130718/736651c6/attachment.html>


More information about the NumPy-Discussion mailing list