This repository was archived by the owner on May 4, 2019. It is now read-only.
This repository was archived by the owner on May 4, 2019. It is now read-only.
getindex broken when using multidimensional index of DataArray{Bool} #292
Open
Description
julia> using DataArrays
julia> da = @data [1 2; NA 4]
2×2 DataArrays.DataArray{Int64,2}:
1 2
NA 4
julia> mask = @data [true false; false true]
2×2 DataArrays.DataArray{Bool,2}:
true false
false true
julia> da[Array{Bool}(mask)]
2-element DataArrays.DataArray{Int64,1}:
1
4
julia> da[mask[:]]
2-element DataArrays.DataArray{Int64,1}:
1
4
julia> da[mask]
ERROR: MethodError: no method matching sub2ind(::Tuple{Int64,Int64}, ::CartesianIndex{2})
Closest candidates are:
sub2ind(::AbstractArray, ::Any...) at abstractarray.jl:1537
sub2ind(::Tuple{Vararg{Integer,N}} where N) at abstractarray.jl:1563
sub2ind(::Tuple{Vararg{Integer,N}} where N, ::Integer...) at abstractarray.jl:1581
...
Stacktrace:
[1] macro expansion at /Users/omus/.julia/v0.6/DataArrays/src/indexing.jl:140 [inlined]
[2] macro expansion at ./cartesian.jl:64 [inlined]
[3] macro expansion at /Users/omus/.julia/v0.6/DataArrays/src/indexing.jl:139 [inlined]
[4] _unsafe_getindex! at /Users/omus/.julia/v0.6/DataArrays/src/indexing.jl:129 [inlined]
[5] macro expansion at ./multidimensional.jl:460 [inlined]
[6] _unsafe_getindex(::IndexLinear, ::DataArrays.DataArray{Int64,2}, ::Base.LogicalIndex{CartesianIndex{2},Array{Bool,2}}) at ./multidimensional.jl:453
[7] macro expansion at ./multidimensional.jl:442 [inlined]
[8] _getindex at ./multidimensional.jl:438 [inlined]
[9] getindex(::DataArrays.DataArray{Int64,2}, ::DataArrays.DataArray{Bool,2}) at ./abstractarray.jl:882
Metadata
Metadata
Assignees
Labels
No labels
Activity