Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'cost': [350, 250, 200],
'revenue': [200, 350, 400]},
index=['P', 'Q', 'R'])
df
Control the broadcast axis:
df.ne(pd.Series([200, 400], index=["P", "S"]), axis='index')