Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'cost': [350, 250, 200],
'revenue': [200, 350, 400]},
index=['M', 'N', 'O'])
df
Comparison with a scalar, using either the operator or method:
df == 200
df.eq(200)
When comparing to an arbitrary sequence, the number of columns must match the number
elements in other:
df == [350, 200]
Use the method to control the axis:
df.eq([350, 350, 200], axis='index')