davidavdav / NamedArrays.jl

Julia type that implements a drop-in replacement of Array with named dimensions
Other
120 stars 20 forks source link

Having dimensions without names #90

Open nalimilan opened 4 years ago

nalimilan commented 4 years ago

By default the constructor uses A, B, etc. for the names of dimensions. AFAICT there is no way to avoid having a name at all. Would it be possible to use nothing for this? Currently it's accepted, but it still prints nothing:

julia> NamedArray(rand(2, 3), [1:2, 1:3], [nothing, nothing])
2×3 Named Array{Float64,2}
nothing ╲ nothing │        1         2         3
──────────────────┼─────────────────────────────
1                 │ 0.974647  0.607695  0.814261
2                 │ 0.458673  0.327957  0.734594

Maybe this could even be the default, as it doesn't sound very useful to generate arbitrary names. FWIW, R doesn't print anything when dimension names are NULL.

davidavdav commented 4 years ago

Yes this would make sense. Of course for now you can name your dimensions all ""

Also, it should be possible to have only named indexes for a subset of all dimensions.