You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> [rand() for _ in1:3]
3-element Array{Float64,1}:0.0849504775293970.59011102313682940.5850548894960674
julia> [rand() for _ inzip(1:3, 1:5)] # expected this to work as the previous one
ERROR:DimensionMismatch("dimensions must match")
Stacktrace:
[1] promote_shape at ./indices.jl:154 [inlined]
[2] _promote_shape at ./iterators.jl:317 [inlined]
[3] axes at ./iterators.jl:316 [inlined]
[4] _array_for at ./array.jl:598 [inlined]
[5] collect(::Base.Generator{Base.Iterators.Zip{Tuple{UnitRange{Int64},UnitRange{Int64}}},getfield(Main, Symbol("##57#58"))}) at ./array.jl:611
This failure does not make sense to me. Also if I turn the comprehension into loop it works again
for _ inzip(1:3, 1:5)
rand()
end
The text was updated successfully, but these errors were encountered:
Consider
This failure does not make sense to me. Also if I turn the comprehension into loop it works again
The text was updated successfully, but these errors were encountered: