-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]
Description
As far as I can tell, there is currently no idiomatic way of collecting an arbitrary iterable into a Vector{T}. To me this seems like a basic operation. At least, I need it quite often.
collectdoes not always return aVector- Array comprehensions calls
collecton aGenerator, which preserves shape information in some cases. Hence, it does not always returnVector vec(collect(itr))returns an array with shared memory. I believe this can be problematic sometimes, but I'm not completely sure.[i for i in itr if true]does work, but is not exactly idiomatic. Also, I don't think it's documented to return aVector.
nickrobinson251, ToucheSir, rfourquet and jishnub
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]