Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ENH: Implement groupby.sample #34069
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
ENH: Implement groupby.sample #34069
Changes from all commits
b91b767
d0cf785
0656332
cb5f105
40966bf
4f2e8da
904bdcd
0db1ed7
cbaf4a5
07dacf2
2935645
3e159a8
2397c3a
8c3dfd8
21923a7
11f3d77
e6579d3
cf41a58
37037c2
540af35
611a1b4
1d3c4d2
c2e1615
c0f9ef1
5ffd4ad
1f733d6
a11487d
0369d22
8ceeed1
279cc3c
daf278b
88ef72c
fb55e08
1a3016a
e2d71e3
c136c1f
372da0e
b1bf65f
04789a1
48eea97
b07b377
b447f85
62f7a15
68d8d4a
572cc6c
97034ae
ad0bd61
05a1ba5
e31a119
56a49a0
27cb1ba
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It it is a BitGenerator, do you use a Generator to produce the random samples or a RandomState. Best practice is to use a Generator since RandomState is effectively frozen in time. If an int, it is used as a seed for
np.random.default_rng()
orRandomState
if NumPy >= 1.17?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.
This is following a pattern similar to the one used in pandas.core.generic.sample of processing the random_state according to pandas.core.common.random_state:
pandas/pandas/core/common.py
Line 394 in c71bfc3