-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cannot create KeyedArray from some tables #96
Comments
That's unfortunate, I guess it's an argument for not using the same function to construct from an array and from a Table. We did not think of this problem when adding the feature, in #21, although we did think that The short-term hack is of course to call the inner function yourself: julia> AxisKeys._wrap_table(KeyedArray, identity, [(a=1, b=2.2), (a=10, b=22.0)], :a, :b)
1-dimensional KeyedArray(NamedDimsArray(...)) with keys:
↓ b ∈ 2-element Vector{Float64}
And data, 2-element Vector{Int64}:
(2.2) 1
(22.0) 10
julia> wrapdims([(a=1, b=2.2), (a=10, b=22.0)], :c)
2-element NamedDimsArray(::Vector{NamedTuple{(:a, :b), Tuple{Int64, Float64}}}, (:c,)):
↓ c (a = 1, b = 2.2)
(a = 10, b = 22.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docs for
wrapdims
sayIt works with the most basic column-table:
but not with a rowtable - an exception gets thrown:
Looks like a wrong method gets dispatched: https://github.com/mcabbott/AxisKeys.jl/blob/master/src/wrap.jl#L87 instead of https://github.com/mcabbott/AxisKeys.jl/blob/master/src/tables.jl#L213.
The text was updated successfully, but these errors were encountered: