I have this line of code:
df['new_column']=df['price'][df['bathrooms']>=2 and df['bathrooms']<3]
Basically, I want to create a new column with the price of a listing (from column price), but only if the bathrooms column contains a value greater than or equal to 2, but less than three. I'm getting the error
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
How do I correct this code?
Thank you!