Skip to content
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

Indexing order is not preserved when indexing by name #213

Open
LilithHafner opened this issue Nov 17, 2022 · 1 comment
Open

Indexing order is not preserved when indexing by name #213

LilithHafner opened this issue Nov 17, 2022 · 1 comment

Comments

@LilithHafner
Copy link

This seems pretty bad to me and I don't think it's documented. I'd like to call it a bug and fix it in minor release if that is acceptable.

julia> x = AxisArray([1,2], [:a, :b])
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [:a, :b]
And data, a 2-element Vector{Int64}:
 1
 2

julia> x[[:a, :b]] # Okay
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [:a, :b]
And data, a 2-element Vector{Int64}:
 1
 2

julia> x[[:b, :a]] # Should flip, but doesn't
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [:a, :b]
And data, a 2-element Vector{Int64}:
 1
 2

julia> x[[2, 1]] # Should flip and does
1-dimensional AxisArray{Int64,1,...} with axes:
    :row, [:b, :a]
And data, a 2-element Vector{Int64}:
 2
 1

Possibly related to #204

@LilithHafner
Copy link
Author

Bump; I would be more than happy to submit a PR if it would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant