[Numpy-discussion] nanmean(), nanstd() and other "missing" functions for 1.8

Sebastian Berg sebastian at sipsolutions.net
Thu May 2 07:15:47 EDT 2013


On Thu, 2013-05-02 at 07:03 -0400, Nathaniel Smith wrote:
> On 1 May 2013 23:12, "Charles R Harris" <charlesr.harris at gmail.com>
> wrote:
> >
> >
> >
> > On Wed, May 1, 2013 at 7:10 PM, Benjamin Root <ben.root at ou.edu>
> wrote:
> >>
> >> So, to summarize the thread so far:
> >>
> >> Consensus:
> >> np.nanmean()
> >> np.nanstd()
> >> np.minmax()
> >> np.argminmax()
> >>
> >> Vague Consensus:
> >> np.sincos()
> >>
> >
> > If the return of sincos (cossin?) is an array, then it could be
> reshaped to be exp(1j*x), which together with exp(2*pi*1j*x) would
> cover some pretty common cases.
> 
> Ufuncs already have some convention for what to do with multiple
> output arguments, right? Presumably whatever they do is what sincos
> should do. (And minmax/argminmax likewise, for consistency, even if
> they aren't ufuncs. Though they could be generalized ufuncs, or minmax
> could be minimummaximum.reduce.)
> 
I think for sincos it makes sense, for an example a ufunc with multiple
arguments is `np.modf`. But I doubt reductions are automatically defined
for these, so minmax probably needs to be a generalized ufunc (can you
have an axis argument with those?). 

- Sebastian

> I haven't checked, but I assume that what multiple output argument
> ufuncs do is to return a tuple. You can't use a single array in the
> general case, because the multiple output types might not be
> homogenous.
> 
> -n
> 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion





More information about the NumPy-Discussion mailing list