-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add ignore_index to DataFrame / Series.sample #38581
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
Comments
take |
@erfannariman Doesn't df.sample(n=3).reset_index() |
I actually wanted to work on this if you don't mind. I was waiting till one of the core devs approved the change. |
yep this is ok to do |
5 tasks
take |
4 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
When sampling a dataframe / series we get the original index back by default, which is good, but we should add an option to ignore the index to keep it consistent with other methods like
drop_duplicates
andexplode
for example.Describe the solution you'd like
Add
ignore_index
argument to Series/DataFrame.sample.API breaking implications
None as far as I can tell.
The text was updated successfully, but these errors were encountered: