Closed njericha closed 1 month ago
Definitively a reasonable request. I can foresee a potential problem when you give integer dimensions to the names:
julia> n = NamedArray(rand(2,2), (["a", "b"], ["one", "two"]), (2, 1))
In such a case I would say that
julia> names(n, 1)
2-element Vector{String}:
"a"
"b"
julia> names(n, Name(1))
2-element Vector{String}:
"one"
"two"
It seams reasonable to ask
names()
for the names along a particular dimension, given the dimension name. Currently, you must know the dimension number to get the names along that axis. For example:where I would expect
names(n, "A") == ["a", "b"]
.My current hack/solution is adding a method to
names()
that finds the matching dimension name from all thedimnames(n)
like so: