Hi Sebastian, > That looks nice, I don't have a clear feeling on the order of items, if > we think of it in terms of `(start, stop)` there was also the idea > voiced to simply add another name in which case you would allow start > and stop to be separate arrays.
Yes, one could add another method. Or perhaps even add a new argument to `.reduce` instead (say `slices`). But this seemed the simplest route... > Of course if go with your `slice(start, stop)` idea that also works, > although passing as separate parameters seems nice too. > > Adding another name (if we can think of one at least) seems pretty good > to me, since I suspect we would add docs to suggest not using > `reduceat`. If we'd want to, even with the present PR it would be possible to (very slowly) deprecate the use of a list of single integers. But I'm trying to go with just making the existing method more useful. > One small thing about the PR: I would like to distinct `default` and > `initial`. I.e. the default value is used only for empty reductions, > while the initial value should be always used (unless you would pass > both, which we don't for normal reductions though). > I suppose the machinery isn't quite set up to do both side-by-side. I just followed what is done for reduce, where a default could also have made sense given that `where` can exclude all inputs along a given row. I'm not convinced it would be necessary to have both, though it would not be hard to add. All the best, Marten _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com