Open
Description
A couple different times I have wanted to construct a 2D array from an iterator of 1D arrays. Is this something that should be added to ndarray?
Roughly, I'm thinking of a function from_rows<I: Iterator<Item=Array1>>(rows: I) -> Array2
and an analogous from_columns
.
One design question that I'm not currently sure about is whether the user should have to specify any information about the dimensions. I am leaning towards "no," especially because it may be difficult to know the size of an iterator beforehand.
Possibly, it would make more sense to collect my iterator and use stack
rather than adding new functionality. However, if this sounds useful, I would be happy to take a whack at implementing it.