Where method on DataFrames can't seem to take series as conditions · Issue #9558 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@max-sixty

Description

@max-sixty

I want to use where to set values across a DataFrame where a Series meets a condition.

For example:

df=pd.DataFrame({'a':[1,2,3], 'b':[4,5,6]})

But this

returns an unedited DataFrame.
Whereas this returns just the middle row, as you'd expect:

Supplying axis=0 or axis=1 doesn't help. Am I doing something wrong? Or this unintended behavior?

Versions
python: 2.7.6.final.0
pandas: 0.14.1