I want to create a new Boolean column on a pandas DataFrame
based on two conditions. The following errors:
df['new'] = df['old'] != 'A' & df['old'] != 'B'
with
TypeError: cannot compare a dtyped [object] array with a scalar of type [bool]
and
and &&
also error.
What is the correct way to do this?