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
{{ message }}
Repository navigation
How to create a 2D ArrayBase or RcArray from a Vec<Vec<f64>>? #197
I would concatenate it to a single flat Vec and then call OwnedArray::from_shape_vec((m, n), v) where v is the single dimensional vector, and m the number of rows, n the number of columns. The method returns a Result and you can use unwrap for example to get the array.
Activity
vbarrielle commentedon May 31, 2016
Maybe you can use something like the
stack!macro to create an OwnedArray, and from there go to an RcArray if that's what you want.bluss commentedon Jun 1, 2016
I would concatenate it to a single flat Vec and then call
OwnedArray::from_shape_vec((m, n), v)wherevis the single dimensional vector, andmthe number of rows,nthe number of columns. The method returns aResultand you can useunwrapfor example to get the array.cgarciae commentedon Jun 4, 2016
Thanks! Found @bluss 's method by myself last week.