Copy rdataframe column into another rdataframe

Hi!

I have two different dataframes with the same number of entries. How can I copy one column of the dataframe 1 into the dataframe 2?

Many thanks!

I don’t know if there is a better way but I found a solution using Take:

auto nptsCol = df1.Take<int>("npoints");
auto df3 = df2.Define("npoints", [&nptsCol](ULong64_t iset){return nptsCol->at(iset);}, {"rdfentry_"});
1 Like