Good day,
I would like to ask if it's possible to access more than one column in a lambda-function inside a pandas-dataframe or if there's an alternative!?
For example my dataframe is looking something like this:
value_a | value_b | value_c
1 | 17 | 8
2 | 253 | 9
3 | 89 | 8
...
I also got a function that is calculating with some of the data:
def some_function(a, b):
...do something:
return c
Now I want to use lambda-function to calculate together with the function but include the data from two columns. Something like this...
df['value_d'] = df['value_b'].apply(lambda x: some_function(x, df['value_c']))
Is it possible to access more than one column inside such a function or is there a better solution?
Hoping my question is understandable.
Thanks to all of you and have a great day!