Question: I want to make a new column based on two variables. I want my new column to have the value "Good" if (column 1 >= .5 or column 2 < 0.5) and (column 1 < .5 or column 2 >= 0.5) otherwise "Bad". 

I tried using `lambda` and `if`. 

```
df["new column"] = df[["column 1", "column 2"]].apply(
    lambda x, y: "Good" if (x >= 0.5 or y < 0.5) and (x < 0.5 or y >= 0.5) else "Bad"
)

```

Got

```
TypeError: ("() missing 1 required positional argument: 'y'", 'occurred at index column 1')

```

Answer: 
Try this:

```
import pandas as pd 

def update_column(row):
    if (row['x'] >= .5 or row['y'] <= .5) and (row['x'] < .5 or row['y'] >= .5):
        return "Good"
    return "Bad"

df['new_column'] = df.apply(update_column, axis=1)

```
You just need to reference the columns by their index in the array you are passing the the lambda expression, like this:

```
df["new column"] = df[["column 1", "column 2"]].apply(
    lambda x: "Good" if (x[0] >= 0.5 or x[1] < 0.5) and (x[0] < 0.5 or x[1] >= 0.5) else "Bad", axis=1
)

```

NOTE: don't forget to include `axis=1`