mirror of https://github.com/python/cpython
Refactor (mostly rearrange) the statistics module (gh-119930)
This commit is contained in:
parent
c618f7d80e
commit
e378dc15b5
1563
Lib/statistics.py
1563
Lib/statistics.py
File diff suppressed because it is too large
Load Diff
|
@ -2435,12 +2435,13 @@ class TestKDE(unittest.TestCase):
|
|||
self.assertGreater(f_hat(100), 0.0)
|
||||
|
||||
def test_kde_kernel_invcdfs(self):
|
||||
kernel_invcdfs = statistics._kernel_invcdfs
|
||||
kernel_specs = statistics._kernel_specs
|
||||
kde = statistics.kde
|
||||
|
||||
# Verify that cdf / invcdf will round trip
|
||||
xarr = [i/100 for i in range(-100, 101)]
|
||||
for kernel, invcdf in kernel_invcdfs.items():
|
||||
for kernel, spec in kernel_specs.items():
|
||||
invcdf = spec['invcdf']
|
||||
with self.subTest(kernel=kernel):
|
||||
cdf = kde([0.0], h=1.0, kernel=kernel, cumulative=True)
|
||||
for x in xarr:
|
||||
|
|
Loading…
Reference in New Issue