Skip to content
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

sampling arbitrary iterables #4

Open
bakkot opened this issue Apr 23, 2024 · 1 comment
Open

sampling arbitrary iterables #4

bakkot opened this issue Apr 23, 2024 · 1 comment

Comments

@bakkot
Copy link

bakkot commented Apr 23, 2024

This has Random.pickFromList, which is a good and useful function when your list is of known length (though a bad name). But when it's not, you can still usefully sample from it (although it's O(n) to do so). Should we expose that functionality?

@tabatkins
Copy link
Collaborator

Yeah, some ability to reservoir sample would be interesting (and very non-trivial to do by hand!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants