Filtering DataFrame based on two conditions

Hi everyone,

I am trying to filter a dataset based on two conditions but it does not allow me to do so unless I write an auxiliary function which in my case is now worth it.

Is there not a way to do the following in a simple way?

filter(:AGE31X => a -> a .== 46 && :percentile_label_Platinum => R -> R .== 35, data)

thanks a lot!

Use:

subset(data, :AGE31X => a -> a .== 46, :percentile_label_Platinum => R -> R .== 35)

or

filter([:AGE31X, :percentile_label_Platinum] => (a, R) -> a == 46 &&  R == 35, data)

or with DataFramesMeta.jl:

@rsubset(data, :AGE31X == 46, :percentile_label_Platinum == 35)
3 Likes