# Another use case for RDataFrame "groupby" like feature

**URL:** <https://root-forum.cern.ch/t/another-use-case-for-rdataframe-groupby-like-feature/55135>\
**Category:** Evolution Proposals, Apps & Ideas\
**Tags:** rdataframe\
**Created:** [June 1, 2023, 2:03pm UTC](https://root-forum.cern.ch/t/another-use-case-for-rdataframe-groupby-like-feature/55135 "2023-06-01T14:03:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [June 1, 2023, 4:28pm UTC](https://root-forum.cern.ch/t/another-use-case-for-rdataframe-groupby-like-feature/55135/2 "2023-06-01T16:28:58Z")

</div>

Hi @arizzi ,

> [@arizzi](#):
>
> Is it guaranteed that while globally events are not processed in the same order as the input file(s), at least in each thread they are?

Yes, threads take a contiguous chunk of events and process them in order. Not only, but the chunks will always begin and end at TTree cluster boundaries, so _in principle_ if the K correlated events never (or vanishingly often) cross TTree cluster boundaries you are good.

> [@arizzi](#):
>
> Would it also be possible to add an rdfentry\_ equivalent that corresponds to the global input file order?

This is [Have rdfentry\_ represent the global entry number in the TChain even in MT runs · Issue #12190 · root-project/root · GitHub](https://github.com/root-project/root/issues/12190), it requires some work but it’s in our plans (the last comment in the conversation proposes a development roadmap).

I see how in general this would be solved well by a group-by operation. There was some more discussion of that at [Groupby in RDataFrame](https://root-forum.cern.ch/t/groupby-in-rdataframe/50303) . The problem, of course, is making it efficient for larger-than-memory datasets. I do not think ROOT has that in the plan of work at the moment.

Cheers,  
Enrico

---

_[View the full topic](https://root-forum.cern.ch/t/another-use-case-for-rdataframe-groupby-like-feature/55135)._
