-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getindex should return a NamedArray (even when using n[:]) #57
Comments
Flattening a NamedArray could help to convert it to other kind of datastructure (DataFrame...) |
That's consistent with julia> x = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> x[:]
4-element Array{Int64,1}:
1
3
2
4
|
My question would be: what would the names be in such case? |
The names (or value) of indexes. |
...which are, for your example? |
Something like 24-element Named Array{Float64,1}
A │ B │ C │
───┼───┼───┼──────────
1 │ 1 │ 1 │ ...
... |
You have to be more explicit. What is the result you would have wanted? |
A, B, C columns should looks like using IterTools
collect(product(1:2,1:4,1:3))
Out[4]:
24-element Array{Tuple{Int64,Int64,Int64},1}:
(1, 1, 1)
(2, 1, 1)
(1, 2, 1)
(2, 2, 1)
(1, 3, 1)
(2, 3, 1)
(1, 4, 1)
(2, 4, 1)
(1, 1, 2)
(2, 1, 2)
(1, 2, 2)
(2, 2, 2)
(1, 3, 2)
(2, 3, 2)
(1, 4, 2)
(2, 4, 2)
(1, 1, 3)
(2, 1, 3)
(1, 2, 3)
(2, 2, 3)
(1, 3, 3)
(2, 3, 3)
(1, 4, 3)
(2, 4, 3) and forth column (because we had a 3 dimensions NamedArray) should contains values |
That kind of makes sense. But note that there's no type-stability issue here stricto sensu. |
ok so I'm changing title |
This would also apply to any subset-of-dimensions-preserving reshaping then, I suppose. |
yes but you should noticed that
|
Thanks @davidavdav |
Ah---I could have used |
Sorry I edited my post |
Hello,
I noticed that
but
I was expecting a NamedArray to be returned
Kind regards
The text was updated successfully, but these errors were encountered: