Skip to content

Commit 25971c8

Browse files
committed
Deploying to gh-pages from @ 933c40d 🚀
1 parent b64eb21 commit 25971c8

File tree

531 files changed

+720
-636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

531 files changed

+720
-636
lines changed

.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: e968cae011839ac1eba2e0b83e867117
3+
config: a14babbf9c95feafbe69bc20e146e373
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/asyncio-task.rst.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ Task Object
13201320
with :meth:`uncancel`. :class:`TaskGroup` context managers use
13211321
:func:`uncancel` in a similar fashion.
13221322

1323-
If end-user code is, for some reason, suppresing cancellation by
1323+
If end-user code is, for some reason, suppressing cancellation by
13241324
catching :exc:`CancelledError`, it needs to call this method to remove
13251325
the cancellation state.
13261326

_sources/library/statistics.rst.txt

+46-10
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ The final prediction goes to the largest posterior. This is known as the
10891089
Kernel density estimation
10901090
*************************
10911091

1092-
It is possible to estimate a continuous probability density function
1092+
It is possible to estimate a continuous probability distribution
10931093
from a fixed number of discrete samples.
10941094

10951095
The basic idea is to smooth the data using `a kernel function such as a
@@ -1100,14 +1100,27 @@ which is called the *bandwidth*.
11001100

11011101
.. testcode::
11021102

1103-
def kde_normal(sample, h):
1104-
"Create a continuous probability density function from a sample."
1105-
# Smooth the sample with a normal distribution kernel scaled by h.
1106-
kernel_h = NormalDist(0.0, h).pdf
1107-
n = len(sample)
1103+
from random import choice, random
1104+
1105+
def kde_normal(data, h):
1106+
"Create a continuous probability distribution from discrete samples."
1107+
1108+
# Smooth the data with a normal distribution kernel scaled by h.
1109+
K_h = NormalDist(0.0, h)
1110+
11081111
def pdf(x):
1109-
return sum(kernel_h(x - x_i) for x_i in sample) / n
1110-
return pdf
1112+
'Probability density function. P(x <= X < x+dx) / dx'
1113+
return sum(K_h.pdf(x - x_i) for x_i in data) / len(data)
1114+
1115+
def cdf(x):
1116+
'Cumulative distribution function. P(X <= x)'
1117+
return sum(K_h.cdf(x - x_i) for x_i in data) / len(data)
1118+
1119+
def rand():
1120+
'Random selection from the probability distribution.'
1121+
return choice(data) + K_h.inv_cdf(random())
1122+
1123+
return pdf, cdf, rand
11111124

11121125
`Wikipedia has an example
11131126
<https://en.wikipedia.org/wiki/Kernel_density_estimation#Example>`_
@@ -1117,15 +1130,38 @@ a probability density function estimated from a small sample:
11171130
.. doctest::
11181131

11191132
>>> sample = [-2.1, -1.3, -0.4, 1.9, 5.1, 6.2]
1120-
>>> f_hat = kde_normal(sample, h=1.5)
1133+
>>> pdf, cdf, rand = kde_normal(sample, h=1.5)
11211134
>>> xarr = [i/100 for i in range(-750, 1100)]
1122-
>>> yarr = [f_hat(x) for x in xarr]
1135+
>>> yarr = [pdf(x) for x in xarr]
11231136

11241137
The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:
11251138

11261139
.. image:: kde_example.png
11271140
:alt: Scatter plot of the estimated probability density function.
11281141

1142+
`Resample <https://en.wikipedia.org/wiki/Resampling_(statistics)>`_
1143+
the data to produce 100 new selections:
1144+
1145+
.. doctest::
1146+
1147+
>>> new_selections = [rand() for i in range(100)]
1148+
1149+
Determine the probability of a new selection being below ``2.0``:
1150+
1151+
.. doctest::
1152+
1153+
>>> round(cdf(2.0), 4)
1154+
0.5794
1155+
1156+
Add a new sample data point and find the new CDF at ``2.0``:
1157+
1158+
.. doctest::
1159+
1160+
>>> sample.append(4.9)
1161+
>>> round(cdf(2.0), 4)
1162+
0.5005
1163+
1164+
11291165
..
11301166
# This modelines must appear within the last ten lines of the file.
11311167
kate: indent-width 3; remove-trailing-space on; replace-tabs on; encoding utf-8;

_sources/library/urllib.parse.rst.txt

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ The :mod:`urllib.parse` module defines functions that fall into two broad
3131
categories: URL parsing and URL quoting. These are covered in detail in
3232
the following sections.
3333

34+
This module's functions use the deprecated term ``netloc`` (or ``net_loc``),
35+
which was introduced in :rfc:`1808`. However, this term has been obsoleted by
36+
:rfc:`3986`, which introduced the term ``authority`` as its replacement.
37+
The use of ``netloc`` is continued for backward compatibility.
38+
3439
URL Parsing
3540
-----------
3641

about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ <h3>瀏覽</h3>
402402
<a href="https://www.python.org/psf/donations/">Please donate.</a>
403403
<br />
404404
<br />
405-
最後更新於 May 06, 2024 (09:31 UTC)。
405+
最後更新於 May 07, 2024 (07:49 UTC)。
406406

407407
<a href="/bugs.html">Found a bug</a>?
408408

bugs.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
313313
</section>
314314
<section id="getting-started-contributing-to-python-yourself">
315315
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
316-
<p>除了只是回報您所發現的錯誤之外,同樣也歡迎您提交修正它們的修補程式 (patch)。您可以在 <a class="reference external" href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果您有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,您可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
316+
<p>除了只是回報您所發現的錯誤之外,同樣也歡迎您提交修正它們的修補程式 (patch)。您可以在 <a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果您有任何問題,<a class="reference external" href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,您可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
317317
</section>
318318
</section>
319319

@@ -441,7 +441,7 @@ <h3>瀏覽</h3>
441441
<a href="https://www.python.org/psf/donations/">Please donate.</a>
442442
<br />
443443
<br />
444-
最後更新於 May 06, 2024 (09:31 UTC)。
444+
最後更新於 May 07, 2024 (07:49 UTC)。
445445

446446
<a href="/bugs.html">Found a bug</a>?
447447

c-api/abstract.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ <h3>瀏覽</h3>
412412
<a href="https://www.python.org/psf/donations/">Please donate.</a>
413413
<br />
414414
<br />
415-
最後更新於 May 06, 2024 (09:31 UTC)。
415+
最後更新於 May 07, 2024 (07:49 UTC)。
416416

417417
<a href="/bugs.html">Found a bug</a>?
418418

c-api/allocation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ <h3>瀏覽</h3>
426426
<a href="https://www.python.org/psf/donations/">Please donate.</a>
427427
<br />
428428
<br />
429-
最後更新於 May 06, 2024 (09:31 UTC)。
429+
最後更新於 May 07, 2024 (07:49 UTC)。
430430

431431
<a href="/bugs.html">Found a bug</a>?
432432

c-api/apiabiversion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ <h3>瀏覽</h3>
458458
<a href="https://www.python.org/psf/donations/">Please donate.</a>
459459
<br />
460460
<br />
461-
最後更新於 May 06, 2024 (09:31 UTC)。
461+
最後更新於 May 07, 2024 (07:49 UTC)。
462462

463463
<a href="/bugs.html">Found a bug</a>?
464464

c-api/arg.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ <h3>瀏覽</h3>
969969
<a href="https://www.python.org/psf/donations/">Please donate.</a>
970970
<br />
971971
<br />
972-
最後更新於 May 06, 2024 (09:31 UTC)。
972+
最後更新於 May 07, 2024 (07:49 UTC)。
973973

974974
<a href="/bugs.html">Found a bug</a>?
975975

c-api/bool.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ <h3>瀏覽</h3>
423423
<a href="https://www.python.org/psf/donations/">Please donate.</a>
424424
<br />
425425
<br />
426-
最後更新於 May 06, 2024 (09:31 UTC)。
426+
最後更新於 May 07, 2024 (07:49 UTC)。
427427

428428
<a href="/bugs.html">Found a bug</a>?
429429

c-api/buffer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ <h3>瀏覽</h3>
10961096
<a href="https://www.python.org/psf/donations/">Please donate.</a>
10971097
<br />
10981098
<br />
1099-
最後更新於 May 06, 2024 (09:31 UTC)。
1099+
最後更新於 May 07, 2024 (07:49 UTC)。
11001100

11011101
<a href="/bugs.html">Found a bug</a>?
11021102

c-api/bytearray.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ <h3>瀏覽</h3>
479479
<a href="https://www.python.org/psf/donations/">Please donate.</a>
480480
<br />
481481
<br />
482-
最後更新於 May 06, 2024 (09:31 UTC)。
482+
最後更新於 May 07, 2024 (07:49 UTC)。
483483

484484
<a href="/bugs.html">Found a bug</a>?
485485

c-api/bytes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ <h3>瀏覽</h3>
603603
<a href="https://www.python.org/psf/donations/">Please donate.</a>
604604
<br />
605605
<br />
606-
最後更新於 May 06, 2024 (09:31 UTC)。
606+
最後更新於 May 07, 2024 (07:49 UTC)。
607607

608608
<a href="/bugs.html">Found a bug</a>?
609609

c-api/call.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ <h3>瀏覽</h3>
738738
<a href="https://www.python.org/psf/donations/">Please donate.</a>
739739
<br />
740740
<br />
741-
最後更新於 May 06, 2024 (09:31 UTC)。
741+
最後更新於 May 07, 2024 (07:49 UTC)。
742742

743743
<a href="/bugs.html">Found a bug</a>?
744744

c-api/capsule.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ <h3>瀏覽</h3>
523523
<a href="https://www.python.org/psf/donations/">Please donate.</a>
524524
<br />
525525
<br />
526-
最後更新於 May 06, 2024 (09:31 UTC)。
526+
最後更新於 May 07, 2024 (07:49 UTC)。
527527

528528
<a href="/bugs.html">Found a bug</a>?
529529

c-api/cell.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ <h3>瀏覽</h3>
422422
<a href="https://www.python.org/psf/donations/">Please donate.</a>
423423
<br />
424424
<br />
425-
最後更新於 May 06, 2024 (09:31 UTC)。
425+
最後更新於 May 07, 2024 (07:49 UTC)。
426426

427427
<a href="/bugs.html">Found a bug</a>?
428428

c-api/code.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ <h3>瀏覽</h3>
678678
<a href="https://www.python.org/psf/donations/">Please donate.</a>
679679
<br />
680680
<br />
681-
最後更新於 May 06, 2024 (09:31 UTC)。
681+
最後更新於 May 07, 2024 (07:49 UTC)。
682682

683683
<a href="/bugs.html">Found a bug</a>?
684684

c-api/codec.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ <h3>瀏覽</h3>
527527
<a href="https://www.python.org/psf/donations/">Please donate.</a>
528528
<br />
529529
<br />
530-
最後更新於 May 06, 2024 (09:31 UTC)。
530+
最後更新於 May 07, 2024 (07:49 UTC)。
531531

532532
<a href="/bugs.html">Found a bug</a>?
533533

c-api/complex.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ <h3>瀏覽</h3>
511511
<a href="https://www.python.org/psf/donations/">Please donate.</a>
512512
<br />
513513
<br />
514-
最後更新於 May 06, 2024 (09:31 UTC)。
514+
最後更新於 May 07, 2024 (07:49 UTC)。
515515

516516
<a href="/bugs.html">Found a bug</a>?
517517

c-api/concrete.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ <h3>瀏覽</h3>
546546
<a href="https://www.python.org/psf/donations/">Please donate.</a>
547547
<br />
548548
<br />
549-
最後更新於 May 06, 2024 (09:31 UTC)。
549+
最後更新於 May 07, 2024 (07:49 UTC)。
550550

551551
<a href="/bugs.html">Found a bug</a>?
552552

c-api/contextvars.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ <h3>瀏覽</h3>
533533
<a href="https://www.python.org/psf/donations/">Please donate.</a>
534534
<br />
535535
<br />
536-
最後更新於 May 06, 2024 (09:31 UTC)。
536+
最後更新於 May 07, 2024 (07:49 UTC)。
537537

538538
<a href="/bugs.html">Found a bug</a>?
539539

c-api/conversion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ <h3>瀏覽</h3>
472472
<a href="https://www.python.org/psf/donations/">Please donate.</a>
473473
<br />
474474
<br />
475-
最後更新於 May 06, 2024 (09:31 UTC)。
475+
最後更新於 May 07, 2024 (07:49 UTC)。
476476

477477
<a href="/bugs.html">Found a bug</a>?
478478

c-api/coro.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ <h3>瀏覽</h3>
401401
<a href="https://www.python.org/psf/donations/">Please donate.</a>
402402
<br />
403403
<br />
404-
最後更新於 May 06, 2024 (09:31 UTC)。
404+
最後更新於 May 07, 2024 (07:49 UTC)。
405405

406406
<a href="/bugs.html">Found a bug</a>?
407407

c-api/datetime.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ <h3>瀏覽</h3>
712712
<a href="https://www.python.org/psf/donations/">Please donate.</a>
713713
<br />
714714
<br />
715-
最後更新於 May 06, 2024 (09:31 UTC)。
715+
最後更新於 May 07, 2024 (07:49 UTC)。
716716

717717
<a href="/bugs.html">Found a bug</a>?
718718

c-api/descriptor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ <h3>瀏覽</h3>
416416
<a href="https://www.python.org/psf/donations/">Please donate.</a>
417417
<br />
418418
<br />
419-
最後更新於 May 06, 2024 (09:31 UTC)。
419+
最後更新於 May 07, 2024 (07:49 UTC)。
420420

421421
<a href="/bugs.html">Found a bug</a>?
422422

c-api/dict.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ <h3>瀏覽</h3>
725725
<a href="https://www.python.org/psf/donations/">Please donate.</a>
726726
<br />
727727
<br />
728-
最後更新於 May 06, 2024 (09:31 UTC)。
728+
最後更新於 May 07, 2024 (07:49 UTC)。
729729

730730
<a href="/bugs.html">Found a bug</a>?
731731

c-api/exceptions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ <h3>瀏覽</h3>
17721772
<a href="https://www.python.org/psf/donations/">Please donate.</a>
17731773
<br />
17741774
<br />
1775-
最後更新於 May 06, 2024 (09:31 UTC)。
1775+
最後更新於 May 07, 2024 (07:49 UTC)。
17761776

17771777
<a href="/bugs.html">Found a bug</a>?
17781778

c-api/file.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ <h3>瀏覽</h3>
448448
<a href="https://www.python.org/psf/donations/">Please donate.</a>
449449
<br />
450450
<br />
451-
最後更新於 May 06, 2024 (09:31 UTC)。
451+
最後更新於 May 07, 2024 (07:49 UTC)。
452452

453453
<a href="/bugs.html">Found a bug</a>?
454454

c-api/float.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ <h3>瀏覽</h3>
571571
<a href="https://www.python.org/psf/donations/">Please donate.</a>
572572
<br />
573573
<br />
574-
最後更新於 May 06, 2024 (09:31 UTC)。
574+
最後更新於 May 07, 2024 (07:49 UTC)。
575575

576576
<a href="/bugs.html">Found a bug</a>?
577577

c-api/frame.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ <h3>瀏覽</h3>
582582
<a href="https://www.python.org/psf/donations/">Please donate.</a>
583583
<br />
584584
<br />
585-
最後更新於 May 06, 2024 (09:31 UTC)。
585+
最後更新於 May 07, 2024 (07:49 UTC)。
586586

587587
<a href="/bugs.html">Found a bug</a>?
588588

c-api/function.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ <h3>瀏覽</h3>
550550
<a href="https://www.python.org/psf/donations/">Please donate.</a>
551551
<br />
552552
<br />
553-
最後更新於 May 06, 2024 (09:31 UTC)。
553+
最後更新於 May 07, 2024 (07:49 UTC)。
554554

555555
<a href="/bugs.html">Found a bug</a>?
556556

c-api/gcsupport.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ <h3>瀏覽</h3>
693693
<a href="https://www.python.org/psf/donations/">Please donate.</a>
694694
<br />
695695
<br />
696-
最後更新於 May 06, 2024 (09:31 UTC)。
696+
最後更新於 May 07, 2024 (07:49 UTC)。
697697

698698
<a href="/bugs.html">Found a bug</a>?
699699

c-api/gen.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ <h3>瀏覽</h3>
410410
<a href="https://www.python.org/psf/donations/">Please donate.</a>
411411
<br />
412412
<br />
413-
最後更新於 May 06, 2024 (09:31 UTC)。
413+
最後更新於 May 07, 2024 (07:49 UTC)。
414414

415415
<a href="/bugs.html">Found a bug</a>?
416416

c-api/hash.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ <h3>瀏覽</h3>
432432
<a href="https://www.python.org/psf/donations/">Please donate.</a>
433433
<br />
434434
<br />
435-
最後更新於 May 06, 2024 (09:31 UTC)。
435+
最後更新於 May 07, 2024 (07:49 UTC)。
436436

437437
<a href="/bugs.html">Found a bug</a>?
438438

0 commit comments

Comments
 (0)