Re: [Numpy-discussion] PR to add an initializer kwarg to ufunc.reduce (and similar functions)

2018-04-09 Thread Hameer Abbasi
I've renamed the kwarg to `initial`. I'm willing to make the object dtype changes as well, if someone pointed me to relevant bits of code. Unfortunately, currently, the identity is only used for object dtypes if the reduction is empty. I think this is to prevent things like `0` being passed in the

Re: [Numpy-discussion] PR to add an initializer kwarg to ufunc.reduce (and similar functions)

2018-04-09 Thread Sebastian Berg
On Mon, 2018-04-09 at 13:37 +0200, Hameer Abbasi wrote: > I've renamed the kwarg to `initial`. I'm willing to make the object > dtype changes as well, if someone pointed me to relevant bits of > code. > > Unfortunately, currently, the identity is only used for object dtypes > if the reduction is e

Re: [Numpy-discussion] PR to add an initializer kwarg to ufunc.reduce (and similar functions)

2018-04-09 Thread Hameer Abbasi
> > The reason would be the case of NaN which is not a possible initial > value for the reduction. > Ah, I didn't think of that. However, at least for `min` and `max` this can be accomplished with `fmin` and `fmax`. ___ NumPy-Discussion mailing list NumP

[Numpy-discussion] Changing the return type of np.histogramdd

2018-04-09 Thread Eric Wieser
Numpy has three histogram functions - histogram, histogram2d, and histogramdd. histogram is by far the most widely used, and in the absence of weights and normalization, returns an np.intp count for each bin. histogramdd (for which histogram2d is a wrapper) returns np.float64 in all circumstances