summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2024-04-15 15:08:21 (GMT)
committerGitHub <noreply@github.com>2024-04-15 15:08:21 (GMT)
commit0823f4361850145152a94e9086bede6a000d8a4a (patch)
treeee04b7ced9baaa6effd8d72c98bb93cc3ddaa85c /Doc
parent10f1a2687a080f07bc128e185c854586207f08cf (diff)
downloadcpython-0823f4361850145152a94e9086bede6a000d8a4a.zip
cpython-0823f4361850145152a94e9086bede6a000d8a4a.tar.gz
cpython-0823f4361850145152a94e9086bede6a000d8a4a.tar.bz2
gh-115532: Minor tweaks to kde() (gh-117897)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/statistics.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
index 197c123..873ccd6 100644
--- a/Doc/library/statistics.rst
+++ b/Doc/library/statistics.rst
@@ -1163,7 +1163,7 @@ accurately approximated inverse cumulative distribution function.
.. testcode::
from random import choice, random, seed
- from math import sqrt, log, pi, tan, asin
+ from math import sqrt, log, pi, tan, asin, cos, acos
from statistics import NormalDist
kernel_invcdfs = {
@@ -1172,6 +1172,7 @@ accurately approximated inverse cumulative distribution function.
'sigmoid': lambda p: log(tan(p * pi/2)),
'rectangular': lambda p: 2*p - 1,
'triangular': lambda p: sqrt(2*p) - 1 if p < 0.5 else 1 - sqrt(2 - 2*p),
+ 'parabolic': lambda p: 2 * cos((acos(2*p-1) + pi) / 3),
'cosine': lambda p: 2*asin(2*p - 1)/pi,
}