Hi everyone,
I’m new to Julia, comming from Python. I was a bit confused when defining an array as a list of lists in Python, I noticed that it isn’t an array of size(m,n).
I searched the WEB and here, for an inplace conversion of an array of size (m,n) to an m-element array, but couldn’t find any example/reference. Is such a conversion possible?
Example, if I have an array:
arr = rand(1:15, (3,4))
3×4 Array{Int64,2}:
6 8 8 13
4 3 14 6
14 13 1 12
I need to convert it inplace into:
[[6, 8, 8, 13],
[4, 3, 14, 6],
[14, 13, 1, 12]]
At the moment I defined the associated m-element array by:
elarr = [arr[k, :] for k in 1:m]
but for a big m and n it is memory consuming to have both arr
and elarr
defined.