Skip to content

Add np.intc to _factorizers in pd.merge #52478

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 0 commits into from

Conversation

hoxbro
Copy link
Contributor

@hoxbro hoxbro commented Apr 6, 2023

@phofl
Copy link
Member

phofl commented Apr 6, 2023

Did this fail on main as well? Couldn't reproduce on main yesterday

@hoxbro
Copy link
Contributor Author

hoxbro commented Apr 6, 2023

Did not test on main. I don't have a Windows computer before next week.

Did you test on Windows? Because I can see on Linux np.intc == np.int32.

@@ -109,6 +109,7 @@
np.int64: libhashtable.Int64Factorizer,
np.longlong: libhashtable.Int64Factorizer,
np.int32: libhashtable.Int32Factorizer,
np.intc: libhashtable.Int32Factorizer,
Copy link
Member

Choose a reason for hiding this comment

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

is this going to be platform-dependent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can see, an actual np.intc is only available on Windows, and for Linux (and probably also Mac OS) it is np.int32.

TBH, I did not know about np.intc before some tests started failing.

Copy link
Member

Choose a reason for hiding this comment

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

Do we have a generic IntFactorizer? It is a bit pedantic since I think most distributions will have an int be 32 bits, but that definitely is not a guarantee

Copy link
Member

Choose a reason for hiding this comment

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

iirc @seberg mentioned hoping to get rid of np.intc in numpy 2.0

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not worried about intc, bu its system dependend, it doesn't have to be 32bit, though. cnp.int_t is what worries me a bit, because its long, but if we want 64bit on windows it won't match up with np.array([1]) anymore.

Copy link
Member

Choose a reason for hiding this comment

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

I assume this regression came as part of #49876
To avoid going down a rabbit hole I would be OK with just setting this specific case back to the Int64Factorizer. @phofl

@mroeschke mroeschke added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Apr 7, 2023
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 11, 2023
@hoxbro hoxbro closed this May 11, 2023
@hoxbro hoxbro deleted the merge_intc branch May 11, 2023 09:03
@hoxbro
Copy link
Contributor Author

hoxbro commented May 11, 2023

I accidentally force-pushed the main into this branch, which was why this PR was closed. I will open a new PR with the changes, though I will change Int32Factorizer to Int64Factorizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.merge fail with numpy.intc on Windows
6 participants