Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee43ed7

Browse files
committed
.
1 parent d71ca9d commit ee43ed7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/statistics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,15 +1788,15 @@ def kde_random(data, h, kernel='normal', *, seed=None):
17881788
if h <= 0.0:
17891789
raise StatisticsError(f'Bandwidth h must be positive, not {h=!r}')
17901790

1791-
prng = _random.Random(seed)
1792-
random = prng.random
1793-
choice = prng.choice
1794-
17951791
try:
17961792
kernel_invcdf = _kernel_invcdfs[kernel]
17971793
except KeyError:
17981794
raise StatisticsError(f'Unknown kernel name: {kernel!r}')
17991795

1796+
prng = _random.Random(seed)
1797+
random = prng.random
1798+
choice = prng.choice
1799+
18001800
def rand():
18011801
return choice(data) + h * kernel_invcdf(random())
18021802

0 commit comments

Comments
 (0)