InvertedIndices.jl
InvertedIndices.jl copied to clipboard
A simple index type that allows for inverted selections
See https://github.com/JuliaLang/julia/issues/53591 for details.
On version 1.1: ``` julia> tup = (x=1, y=2) (x = 1, y = 2) julia> tup[Not(:x)] ERROR: MethodError: no method matching getindex(::NamedTuple{(:x, :y), Tuple{Int64, Int64}}, ::InvertedIndex{Symbol}) Closest candidates are:...
We have the following super bad behavior: ``` julia> [1, 2, 3, 4][Not(Not([1.5]))] 1-element Vector{Int64}: 2 julia> [1, 2, 3, 4][Not(Not([1.5]))] 1-element Vector{Int64}: 0 julia> [1, 2, 3, 4][Not(Not([1.5]))] 1-element...
I tried to compare the performance of indexing : ```julia function benchindexing(a, not) print("indexing by `!in(not)`: ") @btime $a[map(!in($not), axes($a, 1))] print("indexing by `!in(Set(not))`:") @btime $a[map(!in(Set($not)), axes($a, 1))] print("indexing by...
It's a really minor thing, but displaying `InvertedIndexIterator` as `Not` (cf. [this line](https://github.com/mbauman/InvertedIndices.jl/blob/7c97b19e6c75043f231f9d8e6661886b688259f1/src/InvertedIndices.jl#L76)) made it really hard for me to find out how to convert an inverted index to a...
This is a super helpful package -- thanks for making it! I noticed that when working with sparse matrices, the package seems to be doing something funny with the nzval...
Is there any reason why `checkindex(::Type{Bool}, ..., ::InvertedIndex)` isn't implemented? CategoricalArrays currently doesn't work with `Not` because of this (https://github.com/JuliaData/CategoricalArrays.jl/issues/296): ```julia julia> using CategoricalArrays, InvertedIndices julia> categorical(1:10)[Not([3])] ERROR: ArgumentError: unable...
Currently, `Not` has a vararg form which is equivalent to the normal form: ```julia julia> x = 1:4; julia> x[Not(2, 3)] == x[Not([2, 3])] true ``` But this doesn't work...
This issue is motivated by a recent PR to DataFrames [here](https://github.com/JuliaData/DataFrames.jl/pull/2228#issuecomment-624310010). We would like to add the functionality ``` julia> df = DataFrame(a = rand(2), b = rand(2)); julia> select(df,...
I went to port [Jackknife](https://github.com/ararslan/Jackknife.jl) over to use InvertedIndices, but I noticed something... suboptimal. Below are some timings for using InvertedIndices (`thing1`) and using the current naive approach for skipping...