Skip to content
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

diff(Vector,dims=1) #27957

Closed
PaulSoderlind opened this issue Jul 6, 2018 · 5 comments · Fixed by #29827
Closed

diff(Vector,dims=1) #27957

PaulSoderlind opened this issue Jul 6, 2018 · 5 comments · Fixed by #29827
Labels
arrays [a, r, r, a, y, s] help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@PaulSoderlind
Copy link
Contributor

in 0.7.0-beta.108,
diff(ones(6),dims=1) gives

ERROR: MethodError: no method matching diff(::Array{Float64,1}; dims=1)

In contrast, sum(ones(6),dims=1) works.

@martinholters
Copy link
Member

Yes, I don't see why we shouldn't have a general diff(A::AbstractArray; dims) method which would also cover the Vector case.

@JeffBezanson JeffBezanson added the arrays [a, r, r, a, y, s] label Jul 6, 2018
@mbauman mbauman added the help wanted Indicates that a maintainer wants help on an issue or pull request label Jul 9, 2018
@deepaknalore
Copy link

@PaulSoderlind Hey A newbie here. Can you please point me at the right direction?

@PaulSoderlind
Copy link
Contributor Author

PaulSoderlind commented Aug 17, 2018 via email

@shaktee
Copy link

shaktee commented Aug 25, 2018

What should its be behavior be?

Is it expected to be the same as

julia> reduce((x,y) -> x-y, ones(6))
-4.0

@PaulSoderlind
Copy link
Contributor Author

PaulSoderlind commented Aug 25, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants