Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'cost': [350, 250, 200],
                   'revenue': [200, 350, 400]},
                  index=['P', 'Q', 'R'])
df
Out[2]:
cost revenue
P 350 200
Q 250 350
R 200 400

Control the broadcast axis:

In [3]:
df.ne(pd.Series([200, 400], index=["P", "S"]), axis='index')
Out[3]:
cost revenue
P True False
Q True True
R True True
S True True