create new pandas dataframe column based on if-else condition with a lookup
I have a pandas dataframe and I need to create a new column based on an if-else condition. This question already came up here multiple times (e.g., Creating a new column based on if-elif-else condition ). However, I cannot apply the proposed solution, since I also need to look up values in a list in order to check the condition. I cannot do this with the proposed solution, because I am not sure how I can access my lookup-list in the external function. My lookup-list would need to be global, which I want to avoid. I have the feeling there should be a better way to do this. Consider the