@@ -514,15 +514,14 @@ However, for reading convenience, most of the examples show sorted sequences.
514514
515515 Set *n * to 4 for quartiles (the default). Set *n * to 10 for deciles. Set
516516 *n * to 100 for percentiles which gives the 99 cuts points that separate
517- *data * in to 100 equal sized groups. Raises :exc: `StatisticsError ` if *n *
517+ *data * into 100 equal sized groups. Raises :exc: `StatisticsError ` if *n *
518518 is not least 1.
519519
520- The *data * can be any iterable containing sample data or it can be an
521- instance of a class that defines an :meth: `~inv_cdf ` method. For meaningful
520+ The *data * can be any iterable containing sample data. For meaningful
522521 results, the number of data points in *data * should be larger than *n *.
523522 Raises :exc: `StatisticsError ` if there are not at least two data points.
524523
525- For sample data, the cut points are linearly interpolated from the
524+ The cut points are linearly interpolated from the
526525 two nearest data points. For example, if a cut point falls one-third
527526 of the distance between two sample values, ``100 `` and ``112 ``, the
528527 cut-point will evaluate to ``104 ``.
@@ -547,9 +546,6 @@ However, for reading convenience, most of the examples show sorted sequences.
547546 values, the method sorts them and assigns the following percentiles:
548547 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%.
549548
550- If *data * is an instance of a class that defines an
551- :meth: `~inv_cdf ` method, setting *method * has no effect.
552-
553549 .. doctest ::
554550
555551 # Decile cut points for empirically sampled data
@@ -561,11 +557,6 @@ However, for reading convenience, most of the examples show sorted sequences.
561557 >>> [round (q, 1 ) for q in quantiles(data, n = 10 )]
562558 [81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]
563559
564- >>> # Quartile cut points for the standard normal distibution
565- >>> Z = NormalDist()
566- >>> [round (q, 4 ) for q in quantiles(Z, n = 4 )]
567- [-0.6745, 0.0, 0.6745]
568-
569560 .. versionadded :: 3.8
570561
571562
@@ -607,6 +598,18 @@ of applications in statistics.
607598 <https://en.wikipedia.org/wiki/Arithmetic_mean> `_ of a normal
608599 distribution.
609600
601+ .. attribute :: median
602+
603+ A read-only property for the `median
604+ <https://en.wikipedia.org/wiki/Median> `_ of a normal
605+ distribution.
606+
607+ .. attribute :: mode
608+
609+ A read-only property for the `mode
610+ <https://en.wikipedia.org/wiki/Mode_(statistics)> `_ of a normal
611+ distribution.
612+
610613 .. attribute :: stdev
611614
612615 A read-only property for the `standard deviation
@@ -678,6 +681,16 @@ of applications in statistics.
678681 the two probability density functions
679682 <https://www.rasch.org/rmt/rmt101r.htm> `_.
680683
684+ .. method :: NormalDist.quantiles()
685+
686+ Divide the normal distribution into *n * continuous intervals with
687+ equal probability. Returns a list of (n - 1) cut points separating
688+ the intervals.
689+
690+ Set *n * to 4 for quartiles (the default). Set *n * to 10 for deciles.
691+ Set *n * to 100 for percentiles which gives the 99 cuts points that
692+ separate the normal distribution into 100 equal sized groups.
693+
681694 Instances of :class: `NormalDist ` support addition, subtraction,
682695 multiplication and division by a constant. These operations
683696 are used for translation and scaling. For example:
@@ -733,9 +746,9 @@ Find the `quartiles <https://en.wikipedia.org/wiki/Quartile>`_ and `deciles
733746
734747.. doctest ::
735748
736- >>> list (map (round , quantiles(sat )))
749+ >>> list (map (round , sat. quantiles()))
737750 [928, 1060, 1192]
738- >>> list (map (round , quantiles(sat, n = 10 )))
751+ >>> list (map (round , sat. quantiles(n = 10 )))
739752 [810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310]
740753
741754To estimate the distribution for a model than isn't easy to solve
0 commit comments