Stream: helpdesk (published)

Topic: Dropping Rows By Condition


view this post on Zulip DrChainsaw (Mar 01 2021 at 07:19):

Looks like you didn't put it in the first ED2: ED2[ED2[!, :Total] !=..., !] perhaps, but I dont know by heart if that works.

Consider using filter also, if nothing else then for the sake of readability. DataFrames have pretty good documentation so it can be worth it to skim it to see what is built in already.

view this post on Zulip QuBit (Mar 01 2021 at 07:24):

DrChainsaw said:

Looks like you didn't put it in the first ED2: ED2[ED2[!, :Total], !]... perhaps, but I dont know by heart if that works.

Consider using filter also, if nothing else then for the sake of readability. DataFrames have pretty good documentation so it can be worth it to skim it to see what is built in already.

Hello Dr,

I tested around and was able to implement:

ED3 = ED2[(ED2[!,:Total] .!= "---"),:]

The ! does not work, only the colon (:)

Thank you,

view this post on Zulip QuBit (Mar 01 2021 at 07:33):

DrChainsaw
Yes -- as far as the filter method, the following can be used:

begin
test = filter(:Total => !isequal("---"), ED2)
first(test, 5)
end

Last updated: Nov 06 2024 at 04:40 UTC