Add new column to RDataFrame

Hi Riccardo,
it might be possible, but (currently) not so performant. We are working on better python integration.

See this post and the following: Rdataframe define column of same constant value . You can use TPython::Eval inside a Define/Filter lambda to get a python value into a dataframe expression.

If the result of the model evaluation fits in memory, the most performant way is still to do a single evaluation of the whole dataset, and then index the result. Something like (haven’t tested it):

predictions = ml_model.predict(data)
df = df.Define("prediction", 'float(TPython::Eval("predictions[rdfentry_]"))')