This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Christoph.Deil
Recipients Christoph.Deil, rhettinger
Date 2019-08-21.12:38:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I saw that Python 3.8 will add a NormalDist class:

Personally I don't see the value of adding this to the Python standard lib. The natural progression would be to extend and extend, but in the end only duplicate what already exists in scientific Python packages.
But Ok, I guess this is not up for debate any more?

I'd like to make a specific comment on NormalDist.overlap.
The rest of NormalDist is very standard, but that method is an oddball.
My suggestion is to remove it or to improve the documentation.

Current docstring:

And this docs example:

> What percentage of men and women will have the same height in `two normally
distributed populations with known means and standard deviations


This statement doesn't make sense to me. No two people have the exact same height, I think the answer to this question should be 0%.


n = 100_000; sum(m > w for m, w in zip(men.samples(n), women.samples(n))) / n

I see that for 82% of random (men, women) matches the man will be larger. That's another measure, but still, stating that 50% of men and women have the same height is confusing.

Note that there is a multitude of PDF overlap measures different from this min(pdf1, pdf2) that I think are much more common in statistics and the physical sciences:

And note that the references that are given currently are weird (basic statistics textbooks would be appropriate references IMO, or open references like Wikipedia)
- slides:
- implementation code comment points to which is behind a paywall

Why add this one overlap measure and expose it under the "overlap" method name?

My suggestion would be to be conservative and to remove that method again, before releasing it in 3.8. A reference in the docs could be added to other existing third-party codes (e.g. scipy or the uncertainties package) with further functionality, such as being able to handle correlations or multi-dimensional distributions. For this change I'd be happy to send a PR any time.

Raymond and others interested in this topic - thoughts?

(note: I wrote a MultiNorm class prototype last year at and now wanted to rewrite it and try to find a good API and thus was interested in this NormalDist class and what functionality it offers)
Date User Action Args
2019-08-21 12:38:54Christoph.Deilsetrecipients: + Christoph.Deil, rhettinger
2019-08-21 12:38:54Christoph.Deilsetmessageid: <>
2019-08-21 12:38:54Christoph.Deillinkissue37905 messages
2019-08-21 12:38:52Christoph.Deilcreate