The function custom_function(x, argument_1 = 1, argument_2 = 2) work fine here df = data.with_columns( pl.col("x1").map_batches(custom_function).alias("new_x1") ) is it possible to write/edit values for the arguments of the custom function from within map_batches? Some like df = data.with_columns( pl.col("x1").map_batches(lambda x: custom_function(x, argument_1 = 100, argument_2 = 200).alias("new_x1") ) Or should just edit the arguments outside the context. Continue reading...