# Dataframes: How to conditionally remove rows based on data values?

**URL:** <https://discourse.julialang.org/t/dataframes-how-to-conditionally-remove-rows-based-on-data-values/47538>\
**Category:** General Usage\
**Created:** [September 30, 2020, 1:33pm UTC](https://discourse.julialang.org/t/dataframes-how-to-conditionally-remove-rows-based-on-data-values/47538 "2020-09-30T13:33:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 30, 2020, 1:37pm UTC](https://discourse.julialang.org/t/dataframes-how-to-conditionally-remove-rows-based-on-data-values/47538/2 "2020-09-30T13:37:06Z")

</div>

Not sure about Query but note that you can always subset easily in plain DataFrames:

```julia
df[(df.A .!= "Y") .& (df.B .!= "D"), :]

```

is pretty readable imho.

You might be using `filter` the wrong way around, cf this thread: [The filter function is non-intuitive - #10 by ianfiske](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/10) (although the thread is about the `filter` function, not the Query macro)

---

_[View the full topic](https://discourse.julialang.org/t/dataframes-how-to-conditionally-remove-rows-based-on-data-values/47538)._
