Skip to content

Commit

Permalink
add deleteat! (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored and nalimilan committed Dec 11, 2018
1 parent eebecd2 commit 6a232bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,5 @@ end

refs(A::CategoricalArray) = A.refs
pool(A::CategoricalArray) = A.pool

Base.deleteat!(A::CategoricalArray, inds) = (deleteat!(A.refs, inds); A)
9 changes: 9 additions & 0 deletions test/13_arraycommon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1094,4 +1094,13 @@ end
end
end

@testset "deleteat!" begin
x = ['a':'z';]
y = categorical(x)
deleteat!(x, [1, 3])
deleteat!(y, [1, 3])
@test x == y
@test levels(y) == 'a':'z'
end

end

0 comments on commit 6a232bc

Please sign in to comment.