Hello experts,
I am working with RDataFrame. I already have a dataframe with many columns.
Now I want to create a new column, its values are calculated using three other columns.
df = df.Define("new_column", "column1*column2/column3")
My problem now is, that some values in column3 are zero. In these cases, I want the value of “new_column” to be zero, too.
Is there a way to set single entries to zero? The ForEach
function only does something with single values, it does not save them back in the DataFrame, right?
Maybe one more thing: column1 is correlated to column3, as it is something like "column5*column4*column3"
, defined before. In other words: If the entry/value in column3 is zero, then the same value in column1 is also zero.
So, I did not found any solution to this problem and/or how to access single entries and I hope someone here has an idea, suggestion or solution.
Thanks!
ROOT Version: 6.22