-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 should accept functions and generic iterables #21150
Comments
It looks like I would like to work on it, if this issue is still open, and claim my 1st open-source contribution. Also, if it's not much trouble, I'd like someone to guide me on how to implement this(what are the steps and correct ways to add this into julia) as this would be my 1st open-source contribution/pr. |
Usually your best bet is to start from similar functions, for example |
@timholy thank you for the tip to use P.S. ignore the user account change in the previous comment(this is the same user as @akshu3398). Again apologies for confusion in user. |
Tests and docs are all part of the same change. Once you open a PR, people will help guide through any additional questions during review! |
The idea of a This is more general, and
|
This also does not accept the |
How about this julia> cumsum(x->x^2, 1:2:10)
5-element Array{Int64,1}:
1
10
⋮
165
julia> cumsum(x->x^2, 1:5)
5-element Array{Int64,1}:
1
5
⋮
55
julia> cumsum(*, 1:3, 4:6, 7:9)
3-element Array{Int64,1}:
28
108
270
julia> cumsum(*, [1,2,3], [4,5,6], [7,8,9])
3-element Array{Int64,1}:
28
108
270 I know it's not using |
I would find it useful and also more consistent with sum
The text was updated successfully, but these errors were encountered: