I have 3 columns in a Pandas DataFrame where I have to compare 2 columns.
in simple terms.. result_column = not(column1) or (column2)
I tried the following
df['status'] = ~df['offline'] | df['online']
but the above line is resulting in the error.
TypeError: bad operand type for unary ~: 'float'
I searched around for solution and found that '~' is used for Series data structure. There isn't any example for the same for DataFrame. Appreciate your time.