df has Columns A,B,C,D,E , assume column "A" is a string and rest are numbers.
df["A"].where(df[B] > 100).dropna()
returning Column "A" wherever "B" has value > 100
my question is that df["A"]
(it's a view of original df) does not have column "B", then how can "where" clause applied with Column B. [where() clause is applied on df["A"]
but not on entire "df"]
type of df["A"]
is a Pandas Series, even then where()
clause on column "B" is bit confusing how this get applied.