Skip to content

Commit 71a9ba5

Browse files
committed
Deploying to gh-pages from @ 8af0ec0 🚀
1 parent 64f95d1 commit 71a9ba5

File tree

528 files changed

+718
-779
lines changed

Some content is hidden

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

528 files changed

+718
-779
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: 7c070df85c653b9c5deda6afc4036ae0
3+
config: 39e69bf6b640a58958a4e9434e1803ac
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/library/statistics.rst.txt

+39-38
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ or sample.
7979
:func:`median` Median (middle value) of data.
8080
:func:`median_low` Low median of data.
8181
:func:`median_high` High median of data.
82-
:func:`median_grouped` Median, or 50th percentile, of grouped data.
82+
:func:`median_grouped` Median (50th percentile) of grouped data.
8383
:func:`mode` Single mode (most common value) of discrete or nominal data.
8484
:func:`multimode` List of modes (most common values) of discrete or nominal data.
8585
:func:`quantiles` Divide data into intervals with equal probability.
@@ -329,55 +329,56 @@ However, for reading convenience, most of the examples show sorted sequences.
329329
be an actual data point rather than interpolated.
330330

331331

332-
.. function:: median_grouped(data, interval=1)
332+
.. function:: median_grouped(data, interval=1.0)
333333

334-
Return the median of grouped continuous data, calculated as the 50th
335-
percentile, using interpolation. If *data* is empty, :exc:`StatisticsError`
336-
is raised. *data* can be a sequence or iterable.
334+
Estimates the median for numeric data that has been `grouped or binned
335+
<https://en.wikipedia.org/wiki/Data_binning>`_ around the midpoints
336+
of consecutive, fixed-width intervals.
337337

338-
.. doctest::
338+
The *data* can be any iterable of numeric data with each value being
339+
exactly the midpoint of a bin. At least one value must be present.
339340

340-
>>> median_grouped([52, 52, 53, 54])
341-
52.5
341+
The *interval* is the width of each bin.
342342

343-
In the following example, the data are rounded, so that each value represents
344-
the midpoint of data classes, e.g. 1 is the midpoint of the class 0.5--1.5, 2
345-
is the midpoint of 1.5--2.5, 3 is the midpoint of 2.5--3.5, etc. With the data
346-
given, the middle value falls somewhere in the class 3.5--4.5, and
347-
interpolation is used to estimate it:
343+
For example, demographic information may have been summarized into
344+
consecutive ten-year age groups with each group being represented
345+
by the 5-year midpoints of the intervals:
348346

349347
.. doctest::
350348

351-
>>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
352-
3.7
353-
354-
Optional argument *interval* represents the class interval, and defaults
355-
to 1. Changing the class interval naturally will change the interpolation:
349+
>>> from collections import Counter
350+
>>> demographics = Counter({
351+
... 25: 172, # 20 to 30 years old
352+
... 35: 484, # 30 to 40 years old
353+
... 45: 387, # 40 to 50 years old
354+
... 55: 22, # 50 to 60 years old
355+
... 65: 6, # 60 to 70 years old
356+
... })
357+
...
358+
359+
The 50th percentile (median) is the 536th person out of the 1071
360+
member cohort. That person is in the 30 to 40 year old age group.
361+
362+
The regular :func:`median` function would assume that everyone in the
363+
tricenarian age group was exactly 35 years old. A more tenable
364+
assumption is that the 484 members of that age group are evenly
365+
distributed between 30 and 40. For that, we use
366+
:func:`median_grouped`:
356367

357368
.. doctest::
358369

359-
>>> median_grouped([1, 3, 3, 5, 7], interval=1)
360-
3.25
361-
>>> median_grouped([1, 3, 3, 5, 7], interval=2)
362-
3.5
363-
364-
This function does not check whether the data points are at least
365-
*interval* apart.
366-
367-
.. impl-detail::
368-
369-
Under some circumstances, :func:`median_grouped` may coerce data points to
370-
floats. This behaviour is likely to change in the future.
371-
372-
.. seealso::
370+
>>> data = list(demographics.elements())
371+
>>> median(data)
372+
35
373+
>>> round(median_grouped(data, interval=10), 1)
374+
37.5
373375

374-
* "Statistics for the Behavioral Sciences", Frederick J Gravetter and
375-
Larry B Wallnau (8th Edition).
376+
The caller is responsible for making sure the data points are separated
377+
by exact multiples of *interval*. This is essential for getting a
378+
correct result. The function does not check this precondition.
376379

377-
* The `SSMEDIAN
378-
<https://help.gnome.org/users/gnumeric/stable/gnumeric.html#gnumeric-function-SSMEDIAN>`_
379-
function in the Gnome Gnumeric spreadsheet, including `this discussion
380-
<https://mail.gnome.org/archives/gnumeric-list/2011-April/msg00018.html>`_.
380+
Inputs may be any numeric type that can be coerced to a float during
381+
the interpolation step.
381382

382383

383384
.. function:: mode(data)

_sources/reference/datamodel.rst.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,17 @@ Sequences
299299
These represent finite ordered sets indexed by non-negative numbers. The
300300
built-in function :func:`len` returns the number of items of a sequence. When
301301
the length of a sequence is *n*, the index set contains the numbers 0, 1,
302-
..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``.
302+
..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``. Some sequences,
303+
including built-in sequences, interpret negative subscripts by adding the
304+
sequence length. For example, ``a[-2]`` equals ``a[n-2]``, the second to last
305+
item of sequence a with length ``n``.
303306

304307
.. index:: single: slicing
305308

306309
Sequences also support slicing: ``a[i:j]`` selects all items with index *k* such
307310
that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is a
308-
sequence of the same type. This implies that the index set is renumbered so
309-
that it starts at 0.
311+
sequence of the same type. The comment above about negative indexes also applies
312+
to negative slice positions.
310313

311314
Some sequences also support "extended slicing" with a third "step" parameter:
312315
``a[i:j:k]`` selects all items of *a* with index *x* where ``x = i + n*k``, *n*

about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ <h3>瀏覽</h3>
309309
<br />
310310
<br />
311311

312-
最後更新於 Mar 25, 2024 (16:39 UTC)。
312+
最後更新於 Mar 26, 2024 (13:11 UTC)。
313313
<a href="/bugs.html">Found a bug</a>?
314314
<br />
315315

bugs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ <h3>瀏覽</h3>
345345
<br />
346346
<br />
347347

348-
最後更新於 Mar 25, 2024 (16:39 UTC)。
348+
最後更新於 Mar 26, 2024 (13:11 UTC)。
349349
<a href="/bugs.html">Found a bug</a>?
350350
<br />
351351

c-api/abstract.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ <h3>瀏覽</h3>
319319
<br />
320320
<br />
321321

322-
最後更新於 Mar 25, 2024 (16:39 UTC)。
322+
最後更新於 Mar 26, 2024 (13:11 UTC)。
323323
<a href="/bugs.html">Found a bug</a>?
324324
<br />
325325

c-api/allocation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ <h3>瀏覽</h3>
333333
<br />
334334
<br />
335335

336-
最後更新於 Mar 25, 2024 (16:39 UTC)。
336+
最後更新於 Mar 26, 2024 (13:11 UTC)。
337337
<a href="/bugs.html">Found a bug</a>?
338338
<br />
339339

c-api/apiabiversion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>瀏覽</h3>
365365
<br />
366366
<br />
367367

368-
最後更新於 Mar 25, 2024 (16:39 UTC)。
368+
最後更新於 Mar 26, 2024 (13:11 UTC)。
369369
<a href="/bugs.html">Found a bug</a>?
370370
<br />
371371

c-api/arg.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ <h3>瀏覽</h3>
876876
<br />
877877
<br />
878878

879-
最後更新於 Mar 25, 2024 (16:39 UTC)。
879+
最後更新於 Mar 26, 2024 (13:11 UTC)。
880880
<a href="/bugs.html">Found a bug</a>?
881881
<br />
882882

c-api/bool.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ <h3>瀏覽</h3>
330330
<br />
331331
<br />
332332

333-
最後更新於 Mar 25, 2024 (16:39 UTC)。
333+
最後更新於 Mar 26, 2024 (13:11 UTC)。
334334
<a href="/bugs.html">Found a bug</a>?
335335
<br />
336336

c-api/buffer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ <h3>瀏覽</h3>
10031003
<br />
10041004
<br />
10051005

1006-
最後更新於 Mar 25, 2024 (16:39 UTC)。
1006+
最後更新於 Mar 26, 2024 (13:11 UTC)。
10071007
<a href="/bugs.html">Found a bug</a>?
10081008
<br />
10091009

c-api/bytearray.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ <h3>瀏覽</h3>
386386
<br />
387387
<br />
388388

389-
最後更新於 Mar 25, 2024 (16:39 UTC)。
389+
最後更新於 Mar 26, 2024 (13:11 UTC)。
390390
<a href="/bugs.html">Found a bug</a>?
391391
<br />
392392

c-api/bytes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ <h3>瀏覽</h3>
510510
<br />
511511
<br />
512512

513-
最後更新於 Mar 25, 2024 (16:39 UTC)。
513+
最後更新於 Mar 26, 2024 (13:11 UTC)。
514514
<a href="/bugs.html">Found a bug</a>?
515515
<br />
516516

c-api/call.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ <h3>瀏覽</h3>
645645
<br />
646646
<br />
647647

648-
最後更新於 Mar 25, 2024 (16:39 UTC)。
648+
最後更新於 Mar 26, 2024 (13:11 UTC)。
649649
<a href="/bugs.html">Found a bug</a>?
650650
<br />
651651

c-api/capsule.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ <h3>瀏覽</h3>
430430
<br />
431431
<br />
432432

433-
最後更新於 Mar 25, 2024 (16:39 UTC)。
433+
最後更新於 Mar 26, 2024 (13:11 UTC)。
434434
<a href="/bugs.html">Found a bug</a>?
435435
<br />
436436

c-api/cell.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<br />
330330
<br />
331331

332-
最後更新於 Mar 25, 2024 (16:39 UTC)。
332+
最後更新於 Mar 26, 2024 (13:11 UTC)。
333333
<a href="/bugs.html">Found a bug</a>?
334334
<br />
335335

c-api/code.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ <h3>瀏覽</h3>
585585
<br />
586586
<br />
587587

588-
最後更新於 Mar 25, 2024 (16:39 UTC)。
588+
最後更新於 Mar 26, 2024 (13:11 UTC)。
589589
<a href="/bugs.html">Found a bug</a>?
590590
<br />
591591

c-api/codec.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ <h3>瀏覽</h3>
434434
<br />
435435
<br />
436436

437-
最後更新於 Mar 25, 2024 (16:39 UTC)。
437+
最後更新於 Mar 26, 2024 (13:11 UTC)。
438438
<a href="/bugs.html">Found a bug</a>?
439439
<br />
440440

c-api/complex.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ <h3>瀏覽</h3>
418418
<br />
419419
<br />
420420

421-
最後更新於 Mar 25, 2024 (16:39 UTC)。
421+
最後更新於 Mar 26, 2024 (13:11 UTC)。
422422
<a href="/bugs.html">Found a bug</a>?
423423
<br />
424424

c-api/concrete.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ <h3>瀏覽</h3>
453453
<br />
454454
<br />
455455

456-
最後更新於 Mar 25, 2024 (16:39 UTC)。
456+
最後更新於 Mar 26, 2024 (13:11 UTC)。
457457
<a href="/bugs.html">Found a bug</a>?
458458
<br />
459459

c-api/contextvars.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ <h3>瀏覽</h3>
440440
<br />
441441
<br />
442442

443-
最後更新於 Mar 25, 2024 (16:39 UTC)。
443+
最後更新於 Mar 26, 2024 (13:11 UTC)。
444444
<a href="/bugs.html">Found a bug</a>?
445445
<br />
446446

c-api/conversion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ <h3>瀏覽</h3>
379379
<br />
380380
<br />
381381

382-
最後更新於 Mar 25, 2024 (16:39 UTC)。
382+
最後更新於 Mar 26, 2024 (13:11 UTC)。
383383
<a href="/bugs.html">Found a bug</a>?
384384
<br />
385385

c-api/coro.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h3>瀏覽</h3>
308308
<br />
309309
<br />
310310

311-
最後更新於 Mar 25, 2024 (16:39 UTC)。
311+
最後更新於 Mar 26, 2024 (13:11 UTC)。
312312
<a href="/bugs.html">Found a bug</a>?
313313
<br />
314314

c-api/datetime.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ <h3>瀏覽</h3>
619619
<br />
620620
<br />
621621

622-
最後更新於 Mar 25, 2024 (16:39 UTC)。
622+
最後更新於 Mar 26, 2024 (13:11 UTC)。
623623
<a href="/bugs.html">Found a bug</a>?
624624
<br />
625625

c-api/descriptor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ <h3>瀏覽</h3>
323323
<br />
324324
<br />
325325

326-
最後更新於 Mar 25, 2024 (16:39 UTC)。
326+
最後更新於 Mar 26, 2024 (13:11 UTC)。
327327
<a href="/bugs.html">Found a bug</a>?
328328
<br />
329329

c-api/dict.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ <h3>瀏覽</h3>
632632
<br />
633633
<br />
634634

635-
最後更新於 Mar 25, 2024 (16:39 UTC)。
635+
最後更新於 Mar 26, 2024 (13:11 UTC)。
636636
<a href="/bugs.html">Found a bug</a>?
637637
<br />
638638

c-api/exceptions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ <h3>瀏覽</h3>
16781678
<br />
16791679
<br />
16801680

1681-
最後更新於 Mar 25, 2024 (16:39 UTC)。
1681+
最後更新於 Mar 26, 2024 (13:11 UTC)。
16821682
<a href="/bugs.html">Found a bug</a>?
16831683
<br />
16841684

c-api/file.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ <h3>瀏覽</h3>
355355
<br />
356356
<br />
357357

358-
最後更新於 Mar 25, 2024 (16:39 UTC)。
358+
最後更新於 Mar 26, 2024 (13:11 UTC)。
359359
<a href="/bugs.html">Found a bug</a>?
360360
<br />
361361

c-api/float.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ <h3>瀏覽</h3>
478478
<br />
479479
<br />
480480

481-
最後更新於 Mar 25, 2024 (16:39 UTC)。
481+
最後更新於 Mar 26, 2024 (13:11 UTC)。
482482
<a href="/bugs.html">Found a bug</a>?
483483
<br />
484484

c-api/frame.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ <h3>瀏覽</h3>
489489
<br />
490490
<br />
491491

492-
最後更新於 Mar 25, 2024 (16:39 UTC)。
492+
最後更新於 Mar 26, 2024 (13:11 UTC)。
493493
<a href="/bugs.html">Found a bug</a>?
494494
<br />
495495

c-api/function.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ <h3>瀏覽</h3>
457457
<br />
458458
<br />
459459

460-
最後更新於 Mar 25, 2024 (16:39 UTC)。
460+
最後更新於 Mar 26, 2024 (13:11 UTC)。
461461
<a href="/bugs.html">Found a bug</a>?
462462
<br />
463463

c-api/gcsupport.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ <h3>瀏覽</h3>
600600
<br />
601601
<br />
602602

603-
最後更新於 Mar 25, 2024 (16:39 UTC)。
603+
最後更新於 Mar 26, 2024 (13:11 UTC)。
604604
<a href="/bugs.html">Found a bug</a>?
605605
<br />
606606

c-api/gen.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ <h3>瀏覽</h3>
317317
<br />
318318
<br />
319319

320-
最後更新於 Mar 25, 2024 (16:39 UTC)。
320+
最後更新於 Mar 26, 2024 (13:11 UTC)。
321321
<a href="/bugs.html">Found a bug</a>?
322322
<br />
323323

0 commit comments

Comments
 (0)