# PyROOT & RDataFrame: Filter with arrays

**URL:** <https://root-forum.cern.ch/t/pyroot-rdataframe-filter-with-arrays/36504>\
**Category:** ROOT\
**Tags:** rdataframe, python\
**Created:** [October 25, 2019, 3:54am UTC](https://root-forum.cern.ch/t/pyroot-rdataframe-filter-with-arrays/36504 "2019-10-25T03:54:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nathanael](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@Nathanael](https://root-forum.cern.ch/u/Nathanael)\
**Post date:** [October 25, 2019, 11:56am UTC](https://root-forum.cern.ch/t/pyroot-rdataframe-filter-with-arrays/36504/3 "2019-10-25T11:56:28Z")

</div>

Hi Enrico,

thank you for the prompt reply.

Following the example you pointed me to, I should first of all determine the indices of the good muons, i.e. the indices of the muons with Muon\_pt\>0.5 and Muon\_eta\>2.4.

Is there a faster way to filter?

I was having a look at [another topic](https://root-forum.cern.ch/t/pyroot-rdataframe-filter-function-does-not-return-bool/31077/3).

Following one of the answers, it seems that something like (in C++?)

```auto
df.Filter("! Muon_pt[Muon_pt > 0.5].empty()").Filter("! Muon_eta[Muon_eta > 2.4].empty()")

```

should do the same job, right?

---

_[View the full topic](https://root-forum.cern.ch/t/pyroot-rdataframe-filter-with-arrays/36504)._
