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> nums = (i^2for i in Iterators.filter(_->rand(Bool), 1:100));
julia> Base.haslength(nums)
false
julia>stack(nums)'1×44 LinearAlgebra.Adjoint{Int64,Array{Int64,1}}:1494981144196324361400484529…62416561739677447921864910000
julia> vecs = ([i,i^2] for i in Iterators.filter(_->rand(Bool), 1:100));
julia>stack(vecs)
2×54 Array{Int64,2}:2791011131416171820…9092949596981004498110012116919625628932440081008464883690259216960410000
julia> tups = ((i,i^2) for i in Iterators.filter(_->rand(Bool), 1:100));
julia>stack(tups)
ERROR: MethodError: no method matching vec(::Tuple{Int64,Int64})
julia>stack((i,i^2) for i in1:100) # with a length, no problem2×100 Array{Int64,2}:123456789101112…94959697989910014916253649648110012114488369025921694099604980110000
The text was updated successfully, but these errors were encountered:
From https://discourse.julialang.org/t/efficient-way-of-turning-iterator-into-a-matrix/38309:
The text was updated successfully, but these errors were encountered: