I am trying to use two conditions where one is a range of numbers like the following:
df['COL1'] = np.where(df['COL1'] == 4 & (df['COL2'] in range(28,40)), 20, df['COL1'])
When I run this I get the following error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Just wondering if there is a way to get this working or something that could be easier than using np.where