Skip to content

Commit

Permalink
avoid allocation when negating BitArray in dropmissing! (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
OkonSamuel authored Oct 23, 2020
1 parent e07b08d commit 40c368d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/abstractdataframe/abstractdataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,9 @@ julia> dropmissing!(df3, [:x, :y])
function dropmissing!(df::AbstractDataFrame,
cols::Union{ColumnIndex, MultiColumnIndex}=:;
disallowmissing::Bool=true)
delete!(df, (!).(completecases(df, cols)))
inds = completecases(df, cols)
inds .= .!(inds)
delete!(df, inds)
disallowmissing && disallowmissing!(df, cols)
df
end
Expand Down

0 comments on commit 40c368d

Please sign in to comment.