Skip to content

Conversation

@jreback
Copy link
Contributor

@jreback jreback commented Jul 3, 2014

closes #7656

jreback added a commit that referenced this pull request Jul 3, 2014
API: disallow inplace setting with where and a non-np.nan value (GH7656)
@jreback jreback merged commit 161376f into pandas-dev:master Jul 3, 2014
df = DataFrame([{'A': 1, 'B': np.nan, 'C': 'Test'}, {'A': np.nan, 'B': 'Test', 'C': np.nan}])
expected = df.where(~isnull(df), None)
with tm.assertRaisesRegexp(TypeError, 'boolean setting on mixed-type'):
df.where(~isnull(df), None, inplace=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback i dont understand what problem this is solving. This also raises with a non-NA value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas Indexing Related to indexing on series/frames, not to indexes themselves Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataFrame.where does not work as expected with inplace=True

2 participants