Skip to content

REF: expressions bug in Block.where #44631

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

Closed
wants to merge 3 commits into from

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Nov 26, 2021

Probably needs to be done as a deprecation if done for real, but ATM we have no tests that are affected by this (update: we do, just not with my local platform/versions). One would be:

arr = np.arange(6).astype(np.int8).reshape(3, 2)
df = pd.DataFrame(arr)

mask = np.array([[False, True], [False, False], [False, True]])

res = df.where(~mask, 257)

on master, res.dtypes are int8 and int16. In this PR, res.dtypes are both int16.

@jreback jreback added the Internals Related to non-user accessible pandas implementation label Nov 28, 2021
@jbrockmendel jbrockmendel changed the title API: don't downcast ints in Block.where REF: expressions bug in Block.where Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API/DEPR: int downcasting in DataFrame.where
2 participants