# Question on vector\<vector\<int\>\> using RDataFrame

**URL:** <https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864>\
**Category:** Newbie\
**Tags:** rdataframe\
**Created:** [March 7, 2021, 4:14pm UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864 "2021-03-07T16:14:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjohns](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kjohns](https://root-forum.cern.ch/u/kjohns)\
**Post date:** [March 7, 2021, 4:14pm UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864/1 "2021-03-07T16:14:33Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

CentOS Linux release 7.9.2009 (Core)q  
/cvmfs/sft.cern.ch/lcg/releases/LCG\_97a/ROOT/v6.20.06/x86\_64-centos7-gcc8-opt/bin/root

i am trying to read a root tuple created by someone else. the leaves are mostly vector\<vector \>.  
when i create and rdf and use GetColumnType it returns ROOT::VecOps::RVec\<vector\>, which  
is sensible. i read in another posting one needs to create a ROOT.gInterpreter.Declare in order to  
loop over the vector. i am not exactly sure how to do that. my attempt is  
ROOT.gInterpreter.Declare("""  
int break\_vector\_vector(const ROOT::RVec\<vector\>& var1) {  
std::cout \<\< var1.size() \<\< std::endl;  
for (std::size\_t i=0; i\<var1.size(); i++) {  
for (std::size\_t j=0; j\<var1[i].size(); j++) {  
std::cout \<\< i \<\< " " \<\< j \<\< std::endl;  
}  
}  
return 0;  
};  
“”")

an unrelated question is the cout’s done seem to execute within the gInterpreter in rdataframe python.  
is there a trick to using this? thanks in advance. …kj

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 7, 2021, 10:11pm UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864/2 "2021-03-07T22:11:54Z")

</div>

Hi @kjohns; I am sure @eguiraud can help you with this.

Cheers,  
J.

---

<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:** [March 9, 2021, 10:44am UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864/3 "2021-03-09T10:44:06Z")

</div>

Hi @kjohns,  
you are using Python, not C++, correct?

What does not work exactly? The function definition seems ok at first glance. Can you post a self-contained snippet that shows the problem (with full error message)?

Cheers,  
Enrico

---

<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:** [March 12, 2021, 6:04pm UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864/4 "2021-03-12T18:04:05Z")

</div>

Split this topic on March 12, 2021, 6:04pm UTC

8 posts were split to a new topic: [Snapshot of RVec\<RVec\> produces broken ROOT file](https://root-forum.cern.ch/t/snapshot-of-rvec-rvec-t-produces-broken-root-file/43960)

---

<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:** [March 12, 2021, 6:04pm UTC](https://root-forum.cern.ch/t/question-on-vector-vector-int-using-rdataframe/43864/5 "2021-03-12T18:04:42Z")

</div>

Move the conversation with @clementhelsens to another topic. @kjohns let us know if you are still having issues.
