Skip to content

API: disallow inplace setting with where and a non-np.nan value (GH7656) #7657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2014

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