Vectorizing the observationIDs

Hi,

I would like to exclude more than one observation, and the following code would not work.

data_filter1= filter(:ID => !=([2087,2088]), data)

I can do it separately such as following :

data_filter1= filter(:ID => !=(2087), data)
data_filter2= filter(:ID => !=(2088), data)

Hope to hear back from you soon. Thank you!

using DataFramesMeta

data_filter1 = @chain data begin
    @rsubset :ID ∈ [2087, 2088]
end

You can read more about data wrangling here

Thank you so much for your prompt response.
What if we want to remove those two?

image

typed as \notin

1 Like

Thank you.

But, why would it give an error when there is ID included in the dataset?

image

using DataFramesMeta should be used first

1 Like