I would like to make a new column based on an if statement that has conditionals of two or more other columns in a dataframe.
For example, column3 = True if (column1 < 10.0) and (column2 > 0.0).
I have looked around and it seems that other have used the apply method with a lambda function, but i am a bit of a novice on these.
I suppose i could make two additional columns that makes that row a 1 if the condition is met for each column, then sum the columns to check if all conditions are met, but this seems a bit inelegant.
If you provide an answer with apply/lambda, let's suppose the dataframe is called sample_df and the columns are col1, col2, and col3.
Thanks so much!