We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! I am using the groupby function and I notice that the return type is Dict instead of Array.
groupby
Dict
Array
Lazy.jl/src/collections.jl
Lines 44 to 52 in 4324734
julia> groupby(x -> x[1], [(1,2,3), (2,2,3), (1,2,4), (2,3,4)]) Dict{Any,Any} with 2 entries: 2 => Any[(2, 2, 3), (2, 3, 4)] 1 => Any[(1, 2, 3), (1, 2, 4)]
Would it be better if the function returns an Array so the original order could be preserved? Like this:
julia> groupby(x -> x[1], [(1,2,3), (2,2,3), (1,2,4), (2,3,4)]) 2-element Array{Any,1}: Any[(1, 2, 3), (1, 2, 4)] Any[(2, 2, 3), (2, 3, 4)]
Besides, in Haskell, the type signature of groupBy looks like:
groupBy
groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
which returns an Array.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! I am using the
groupby
function and I notice that the return type isDict
instead ofArray
.Lazy.jl/src/collections.jl
Lines 44 to 52 in 4324734
Would it be better if the function returns an
Array
so the original order could be preserved? Like this:Besides, in Haskell, the type signature of
groupBy
looks like:which returns an
Array
.The text was updated successfully, but these errors were encountered: