You're making 1000 slightly different copies of your huge dataframe by
doing it one-by-one. Can you do all 1000 removals at once? Even if you're
finding the rows to remove iteratively, simply store a list of the rows to
remove and batch the removals all together.
Perhaps something like:
function deleterows(df::DataFrame, rows::Array{Int,1})
return df[setdiff(1:end,rows), :]
end
On Thursday, June 12, 2014 10:27:14 AM UTC-4, K leo wrote:
>
> I use the following to delete a row:
>
> function deleterow(df::DataFrame, row::Int)
> return df[[1:row-1, row+1:end], :]
> end
>
> The time it takes to delete 1000 rows in a 22,000-row df is about 16
> seconds.
>
> Are there more efficient ways to do it?
>