Lets say I have a function
def fun(x, y):
return(y.sum() + x)
This function takes in a value to add x, and a database/series to sum y
If I have a database df, that I would like to apply my function to. However, the data base is meant to be the second positional argument not the first.
df.apply(fun, x = 10)
returns an error "("fun() got multiple values for argument 'x'", 'occurred at index 0')
How do I use the apply function so that the database is the second positional argument?