[issue44150] Add optional weights parameter to statistics.fmean()

2021-05-20 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44150] Add optional weights parameter to statistics.fmean()

2021-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +24800
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26175

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44150] Add optional weights parameter to statistics.fmean()

2021-05-16 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Weighted averages are another basic that we should support.

A professor assigns a grade for a course by weighting quizzes at 20%, homework 
at 20%, a midterm exam at 30%, and a final exam at 30%:

>>> grades = [85, 92, 83, 91]
>>> weights = [0.20, 0.20, 0.30, 0.30]
>>> fmean(grades, weights)
87.6

The API here matches that for harmonic_mean() and random.choices(), the other 
places where we support optional weights.

--
components: Library (Lib)
messages: 393751
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Add optional weights parameter to statistics.fmean()
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com