Skip to content

Compute from_sample() in a single pass over the data #92284

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

Merged
merged 44 commits into from
May 4, 2022

Conversation

rhettinger
Copy link
Contributor

There's no need to convert an iterator into a list and make two passes over the data to compute the mean and standard deviation. With a minor modification to the function signature, the existing _ss() function already does all the necessary work in a single pass.

rhettinger and others added 30 commits March 15, 2021 21:12
.
Merge branch 'master' of github.com:python/cpython
.
Merge branch 'master' of github.com:python/cpython
.
Merge branch 'master' of github.com:python/cpython
.
Merge branch 'master' of github.com:python/cpython
Merge branch 'main' of github.com:python/cpython into main
Merge branch 'main' of github.com:python/cpython
@rhettinger rhettinger added performance Performance or resource usage skip issue skip news 3.11 only security fixes labels May 4, 2022
@rhettinger rhettinger self-assigned this May 4, 2022
@rhettinger rhettinger merged commit 9badc86 into python:main May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes performance Performance or resource usage skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants