# Events with exactly two Taus in RDataFrame

**URL:** <https://root-forum.cern.ch/t/events-with-exactly-two-taus-in-rdataframe/47983>\
**Category:** Newbie\
**Tags:** rdataframe, python\
**Created:** [December 7, 2021, 4:44pm UTC](https://root-forum.cern.ch/t/events-with-exactly-two-taus-in-rdataframe/47983 "2021-12-07T16:44:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@Cesar1](https://root-forum.cern.ch/u/Cesar1)\
**Post date:** [December 7, 2021, 4:44pm UTC](https://root-forum.cern.ch/t/events-with-exactly-two-taus-in-rdataframe/47983/1 "2021-12-07T16:44:29Z")

</div>

Hello rooters,

I am having some trouble trying to figure out how to make a “cut” in a data frame, such as the only events that pass the filter are those events with two taus. I have a branch of tree called TauPt which is an array with entries TauPt[0] for the leading and TauPt[1] for the subleading. So i want those events that have both entries filled.

Best Regards,  
Cesar.

---

<div class="post-metadata">

**Author:** ![Cesar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@Cesar1](https://root-forum.cern.ch/u/Cesar1)\
**Post date:** [December 7, 2021, 6:26pm UTC](https://root-forum.cern.ch/t/events-with-exactly-two-taus-in-rdataframe/47983/2 "2021-12-07T18:26:38Z")

</div>

This is actually simple, i just did this:

```auto
df = df.Define("nTaus", "TauPt.size()")
df = df.Filter("nTaus == 2", "Events with exactly two Taus")

```

And solved my problem!
