Problems filtering a vector with a scalar

I’m trying to filter values of a RDFrame, but the elements in the RDFrame are vectors and it seems like i’m trying to do vector to scalar comparison.

Been trying to do
df_data.Filter(f'ALL_hits_S == {float(section)}')
where I want to make a histogram of ALL_hists_X[ALL_hits_S == 0] for example
-----±-----------+
| Row | ALL_hits_S |
±----±-----------+
| 0 | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | … |
±----±-----------+
| 1 | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | … |
±----±-----------+
| 2 | 0.000000 |
| | 0.000000 |
| | 0.000000 |
| | 0.000000 |
.
.
.


Platform: Lxplus

Welcome to the ROOT forum.
I guess @vpadulan might help you.

Check out the example in the Documentation (ROOT: ROOT::RDataFrame Class Reference), which uses Define to do the selection.

Dear @abirze ,

Thank you for reaching out to the forum! I agree with @dastudillo , this is a typical example of working with collections in RDataFrame. The idea is that Filter is only useful if you want to either discard or keep the entire event. Instead, if you want to select some values from your collection but still keep the event, you should use Define to create a temporary collection with the correct values and then you can call Histo1D on that new column.

Let us know if it works for you, thanks!
Cheers,
Vincenzo