-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF/ENH: allow Generator in sampling methods #42243
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine a question.
pandas/_typing.py
Outdated
np.random.RandomState, | ||
] | ||
else: | ||
RandomState = Union[int, ArrayLike, np.random.Generator, np.random.RandomState] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm why is BitGenerator not in the 2nd part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BitGenerator isn't exposed until numpy >= 1.18. Have added a comment about this and removed the else clause (since that would mean we're not type checking anyway so the definition doesn't matter)
thanks @mzeitlin11 might need to slightly revist after we drop 1.17 (shortly) |
The perf gap is pretty crazy:
Leaving #28440 open because I think the end goal should still be to make using these the default. But assuming that change isn't too easy since will be a breaking change?