New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cumsum (and accumulation operators generally?) should have an option to leave the identity in the first spot #6044
Comments
Amen, brother! +1 Our |
In this case I actually want both the identity and the final sum to both be On Sat, Jul 4, 2015 at 6:09 PM, Jaime notifications@github.com wrote:
Nathaniel J. Smith -- http://vorpus.org |
Starting indices, e.g. for CSR or CSC sparse matrices don't typically require the last value for anything. I think it also comes up in some of the extra returns of |
Ditto. Indeed, I'm struggling to remember any occasion when I used Big +1 from me to |
See the comments in #14542 for a related discussion. |
I just found myself writing:
and it occured to me that this is definitely not the first time I've found myself doing the awkward concatenate-a-zero dance in order to get a cumsum array whose shape matches what I want. Maybe we should have a convenience argument to
cumsum
(and toufunc.accumulate
in general I guess) to insert the operation's identity as the first argument.No brain to figure out the details of how this would work right now, but filing a bug to remind me/us...
The text was updated successfully, but these errors were encountered: