JuliaArrays / ShiftedArrays.jl

Lazy shifted arrays for data analysis in Julia
Other
50 stars 10 forks source link

No method matching `deleteat!` #40

Open pdeffebach opened 3 years ago

pdeffebach commented 3 years ago

I know that ShiftedArrays is lazy, but this was an annoying bug I got today.


julia> x = [1, 2, 3];

julia> y = lag(x);

julia> deleteat!(y, 2)
ERROR: MethodError: no method matching deleteat!(::ShiftedArray{Int64,Missing,1,Array{Int64,1}}, ::Int64)
Closest candidates are:
  deleteat!(::BitArray{1}, ::Integer) at bitarray.jl:935
  deleteat!(::BitArray{1}, ::Any) at bitarray.jl:966
  deleteat!(::SentinelArrays.MissingVector, ::Integer) at /home/peterwd/.julia/packages/SentinelArrays/Ubf17/src/missingvector.jl:45
  ...
Stacktrace:

filter! in DataFrames uses deleteat!. I'm not sure what the solution here is since I think this would require materializing an array. It's an unfortunate error, though.