pypdevsbbl.extra.mathutils.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>pypdevsbbl.extra.mathutils module &#8212; Python(P)DEVS-BBL documentation</title>
  8. <link rel="stylesheet" href="_static/nature.css" type="text/css" />
  9. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  10. <link rel="stylesheet" type="text/css" href="_static/custom.css" />
  11. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  12. <script type="text/javascript" src="_static/jquery.js"></script>
  13. <script type="text/javascript" src="_static/underscore.js"></script>
  14. <script type="text/javascript" src="_static/doctools.js"></script>
  15. <script type="text/javascript" src="_static/language_data.js"></script>
  16. <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  17. <link rel="index" title="Index" href="genindex.html" />
  18. <link rel="search" title="Search" href="search.html" />
  19. <link rel="next" title="pypdevsbbl.extra.packaging module" href="pypdevsbbl.extra.packaging.html" />
  20. <link rel="prev" title="pypdevsbbl.extra.heap module" href="pypdevsbbl.extra.heap.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="pypdevsbbl.extra.packaging.html" title="pypdevsbbl.extra.packaging module"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="pypdevsbbl.extra.heap.html" title="pypdevsbbl.extra.heap module"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> &#187;</li>
  39. <li class="nav-item nav-item-2"><a href="pypdevsbbl.extra.html" accesskey="U">pypdevsbbl.extra package</a> &#187;</li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <div class="section" id="module-pypdevsbbl.extra.mathutils">
  47. <span id="pypdevsbbl-extra-mathutils-module"></span><h1>pypdevsbbl.extra.mathutils module<a class="headerlink" href="#module-pypdevsbbl.extra.mathutils" title="Permalink to this headline">¶</a></h1>
  48. <p>This file contains the main functionality for having more control over boxplots.</p>
  49. <p>These can be used for custom computation of boxplots, histograms and some other features,
  50. based upon certain algorithms. This way, it is possible to compute these values in
  51. situations where you don’t have access over the entire dataset, but only over a few values
  52. thereof.</p>
  53. <p>There are also some additional helper functions that can be useful in other circumstances
  54. as well.</p>
  55. <dl class="class">
  56. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm">
  57. <em class="property">class </em><code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">BoxplotAlgorithm</code><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#BoxplotAlgorithm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm" title="Permalink to this definition">¶</a></dt>
  58. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p>
  59. <p>Helper enum for creating boxplots of series of <span class="math notranslate nohighlight">\(N\)</span> items.</p>
  60. <p>Boxplots are created with 5 values: [<cite>min</cite>, <cite>Q1</cite>, <cite>median</cite>, <cite>Q3</cite>, <cite>max</cite>]</p>
  61. <p>Even though <cite>Q1</cite> and <cite>Q3</cite> are also defined as being medians, some software
  62. packages use other algorithms for computing these values. This enum allows
  63. a quick and clean access of a set of these other algorithms.</p>
  64. <div class="admonition seealso">
  65. <p class="first admonition-title">See also</p>
  66. <p class="last"><a class="reference internal" href="#pypdevsbbl.extra.mathutils.linear_interpolation" title="pypdevsbbl.extra.mathutils.linear_interpolation"><code class="xref py py-meth docutils literal notranslate"><span class="pre">linear_interpolation()</span></code></a></p>
  67. </div>
  68. <dl class="attribute">
  69. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN">
  70. <code class="descname">MEDIAN</code><em class="property"> = 0</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN" title="Permalink to this definition">¶</a></dt>
  71. <dd><p>Default computation where the <cite>Q1</cite> and <cite>Q3</cite> values are the medians of the
  72. lower list and the upper list of the set split on its global median, respectively.</p>
  73. <p>The global median is not included in the computation. When there is an even amount
  74. of items, the two values that make up the median are both excluded from the
  75. computation.</p>
  76. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  77. on the series if the index is not an integer.</p>
  78. <p><span class="math notranslate nohighlight">\(Q1 = \begin{cases}\dfrac{N}{4}\textrm{ if }N\textrm{ is even}\\\\
  79. \dfrac{N + 1}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\qquad
  80. Q3 = \begin{cases}\dfrac{3\cdot N + 4}{4}\textrm{ if }N\textrm{ is even}\\\\
  81. \dfrac{3\cdot N + 3}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\)</span></p>
  82. </dd></dl>
  83. <dl class="attribute">
  84. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.TUKEY">
  85. <code class="descname">TUKEY</code><em class="property"> = 1</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.TUKEY" title="Permalink to this definition">¶</a></dt>
  86. <dd><p>Computation that’s used by <cite>R</cite> in the <code class="xref py py-meth docutils literal notranslate"><span class="pre">fivenum()</span></code> function and by
  87. <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> for plotting boxplots.</p>
  88. <p>The computation is the same as <a class="reference internal" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN" title="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN"><code class="xref py py-attr docutils literal notranslate"><span class="pre">MEDIAN</span></code></a>, except that the median is included
  89. in the computation.</p>
  90. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  91. on the series if the index is not an integer.</p>
  92. <p><span class="math notranslate nohighlight">\(Q1 = \begin{cases}\dfrac{N + 2}{4}\textrm{ if }N\textrm{ is even}\\\\
  93. \dfrac{N + 3}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\qquad
  94. Q3 = \begin{cases}\dfrac{3\cdot N + 2}{4}\textrm{ if }N\textrm{ is even}\\\\
  95. \dfrac{3\cdot N + 1}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\)</span></p>
  96. </dd></dl>
  97. <dl class="attribute">
  98. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MINITAB">
  99. <code class="descname">MINITAB</code><em class="property"> = 2</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MINITAB" title="Permalink to this definition">¶</a></dt>
  100. <dd><p>Computation that’s used by <cite>Minitab</cite> and by <cite>MS Excel</cite> (in any version later
  101. than 2007, in the <code class="xref py py-meth docutils literal notranslate"><span class="pre">QUARTILE.EXC()</span></code> function).</p>
  102. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  103. on the series if the index is not an integer.</p>
  104. <p><span class="math notranslate nohighlight">\(Q1 = \dfrac{N + 1}{4}\qquad Q3 = \dfrac{3\cdot N + 3}{4}\)</span></p>
  105. </dd></dl>
  106. <dl class="attribute">
  107. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.FREUND_PERLES">
  108. <code class="descname">FREUND_PERLES</code><em class="property"> = 3</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.FREUND_PERLES" title="Permalink to this definition">¶</a></dt>
  109. <dd><p>Computation that’s used by <cite>MS Excel</cite> (version 2007 and earlier use <code class="xref py py-meth docutils literal notranslate"><span class="pre">QUARTILE()</span></code>,
  110. which was replaced in later versions by <code class="xref py py-meth docutils literal notranslate"><span class="pre">QUARTILE.INC()</span></code>), by <cite>R</cite> in the <code class="xref py py-meth docutils literal notranslate"><span class="pre">summary()</span></code>
  111. function and by <code class="xref py py-meth docutils literal notranslate"><span class="pre">numpy.percentile()</span></code> (with a linear interpolation).</p>
  112. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  113. on the series if the index is not an integer.</p>
  114. <p><span class="math notranslate nohighlight">\(Q1 = \dfrac{N + 3}{4}\qquad Q3 = \dfrac{3\cdot N + 1}{4}\)</span></p>
  115. </dd></dl>
  116. <dl class="attribute">
  117. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MOORE_MCCABE">
  118. <code class="descname">MOORE_MCCABE</code><em class="property"> = 4</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MOORE_MCCABE" title="Permalink to this definition">¶</a></dt>
  119. <dd><p>Similar to <a class="reference internal" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN" title="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN"><code class="xref py py-attr docutils literal notranslate"><span class="pre">MEDIAN</span></code></a>, as is it used in the <cite>TI-83</cite> calculators for boxplots.</p>
  120. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  121. on the series if the index is not an integer.</p>
  122. <p><span class="math notranslate nohighlight">\(Q1 = \begin{cases}\dfrac{N + 2}{4}\textrm{ if }N\textrm{ is even}\\\\
  123. \dfrac{N + 1}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\qquad
  124. Q3 = \begin{cases}\dfrac{3\cdot N + 2}{4}\textrm{ if }N\textrm{ is even}\\\\
  125. \dfrac{3\cdot N + 3}{4}\textrm{ if }N\textrm{ is odd}\end{cases}\)</span></p>
  126. </dd></dl>
  127. <dl class="attribute">
  128. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MENDENHALL_SINCICH">
  129. <code class="descname">MENDENHALL_SINCICH</code><em class="property"> = 5</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MENDENHALL_SINCICH" title="Permalink to this definition">¶</a></dt>
  130. <dd><p>Same as <a class="reference internal" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MINITAB" title="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MINITAB"><code class="xref py py-attr docutils literal notranslate"><span class="pre">MINITAB</span></code></a>, except this method uses rounding for its computations.</p>
  131. <p>Computes the element at indexes <cite>Q1</cite> and <cite>Q3</cite> and determines a linear interpolation
  132. on the series if the index is not an integer.</p>
  133. <p><span class="math notranslate nohighlight">\(Q1 = \left\lfloor\dfrac{N + 1}{4}\right\rfloor\qquad
  134. Q3 = \left\lceil\dfrac{3\cdot N + 3}{4}\right\rceil\)</span></p>
  135. </dd></dl>
  136. <dl class="attribute">
  137. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.FAME">
  138. <code class="descname">FAME</code><em class="property"> = 6</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.FAME" title="Permalink to this definition">¶</a></dt>
  139. <dd><p>Computes the <cite>Q1</cite> and <cite>Q3</cite> values via the <em>Fast Algorithm for Median Estimation</em>.</p>
  140. <div class="admonition seealso">
  141. <p class="first admonition-title">See also</p>
  142. <p class="last"><a class="reference internal" href="#pypdevsbbl.extra.mathutils.FAME" title="pypdevsbbl.extra.mathutils.FAME"><code class="xref py py-meth docutils literal notranslate"><span class="pre">FAME()</span></code></a></p>
  143. </div>
  144. </dd></dl>
  145. <dl class="attribute">
  146. <dt id="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.P_SQUARE">
  147. <code class="descname">P_SQUARE</code><em class="property"> = 7</em><a class="headerlink" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.P_SQUARE" title="Permalink to this definition">¶</a></dt>
  148. <dd><p>Computes the <cite>Q1</cite> and <cite>Q3</cite> values via the <em>P^2 Algorithm for Dynamic Calculation of Quantiles
  149. and Histograms without Scoring Observations</em>.</p>
  150. <div class="admonition seealso">
  151. <p class="first admonition-title">See also</p>
  152. <ul class="last simple">
  153. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.histogram" title="pypdevsbbl.extra.mathutils.histogram"><code class="xref py py-meth docutils literal notranslate"><span class="pre">histogram()</span></code></a></li>
  154. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.histostep" title="pypdevsbbl.extra.mathutils.histostep"><code class="xref py py-meth docutils literal notranslate"><span class="pre">histostep()</span></code></a></li>
  155. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.PPP" title="pypdevsbbl.extra.mathutils.PPP"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PPP()</span></code></a></li>
  156. </ul>
  157. </div>
  158. </dd></dl>
  159. </dd></dl>
  160. <dl class="function">
  161. <dt id="pypdevsbbl.extra.mathutils.compute_boxplot">
  162. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">compute_boxplot</code><span class="sig-paren">(</span><em>series: list</em>, <em>algorithm: pypdevsbbl.extra.mathutils.BoxplotAlgorithm = &lt;BoxplotAlgorithm.MEDIAN: 0&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#compute_boxplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.compute_boxplot" title="Permalink to this definition">¶</a></dt>
  163. <dd><p>Compute the boxplot values for a series.</p>
  164. <p>This function computes the [<cite>min</cite>, <cite>Q1</cite>, <cite>median</cite>, <cite>Q3</cite>, <cite>max</cite>] set of a series,
  165. based upon a certain algorithm.</p>
  166. <div class="admonition note">
  167. <p class="first admonition-title">Note</p>
  168. <p class="last">The median in the result is the definition-wise median and not computed with some
  169. other algorithm.</p>
  170. </div>
  171. <div class="admonition seealso">
  172. <p class="first admonition-title">See also</p>
  173. <p class="last"><a class="reference internal" href="#pypdevsbbl.extra.mathutils.linear_interpolation" title="pypdevsbbl.extra.mathutils.linear_interpolation"><code class="xref py py-meth docutils literal notranslate"><span class="pre">linear_interpolation()</span></code></a></p>
  174. </div>
  175. <table class="docutils field-list" frame="void" rules="none">
  176. <col class="field-name" />
  177. <col class="field-body" />
  178. <tbody valign="top">
  179. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  180. <li><strong>series</strong> (<em>list</em>) – A list of numeric vales from which a boxplot
  181. must be computed.</li>
  182. <li><strong>algorithm</strong> (<a class="reference internal" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm" title="pypdevsbbl.extra.mathutils.BoxplotAlgorithm"><em>BoxplotAlgorithm</em></a>) – The algorithm to use for computing the data.
  183. Even though the <cite>Q1</cite> and <cite>Q3</cite> values are technically defined as
  184. medians, some software actually use other computations for these
  185. values. Defaults to <a class="reference internal" href="#pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN" title="pypdevsbbl.extra.mathutils.BoxplotAlgorithm.MEDIAN"><code class="xref py py-attr docutils literal notranslate"><span class="pre">BoxplotAlgorithm.MEDIAN</span></code></a>.</li>
  186. </ul>
  187. </td>
  188. </tr>
  189. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with keys [min, Q1, median, Q3, max] and their corresponding values.</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. </dd></dl>
  195. <dl class="function">
  196. <dt id="pypdevsbbl.extra.mathutils.FAME">
  197. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">FAME</code><span class="sig-paren">(</span><em>series: list</em>, <em>b=0.1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#FAME"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.FAME" title="Permalink to this definition">¶</a></dt>
  198. <dd><p>Do the <cite>FAME</cite> algorithm based upon a series.</p>
  199. <p>Loops throughout the entire series and tries to estimate the median.
  200. Please note that this is a mere estimate and not at all the actual
  201. median!</p>
  202. <p><cite>FAME</cite> (Fast Algorithm for Median Estimation) is described in
  203. <em>An Optimal Median Calculation Algorithm for Estimating Internet Link
  204. Delays From Active Measurements</em> by <cite>Dima Feldman</cite> and <cite>Yuval Shavitt</cite>
  205. at the university of Tel-Aviv, 2007.</p>
  206. <div class="admonition seealso">
  207. <p class="first admonition-title">See also</p>
  208. <ul class="last simple">
  209. <li><a class="reference external" href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.108.7376&amp;rep=rep1&amp;type=pdf">http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.108.7376&amp;rep=rep1&amp;type=pdf</a> (paper)</li>
  210. <li><a class="reference external" href="http://www.eng.tau.ac.il/~shavitt/courses/LargeG/streaming-median.pdf">http://www.eng.tau.ac.il/~shavitt/courses/LargeG/streaming-median.pdf</a></li>
  211. </ul>
  212. </div>
  213. <table class="docutils field-list" frame="void" rules="none">
  214. <col class="field-name" />
  215. <col class="field-body" />
  216. <tbody valign="top">
  217. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  218. <li><strong>series</strong> (<em>list</em>) – The series to loop through.</li>
  219. <li><strong>b</strong> (<em>numeric</em>) – Minimal initial step size. Defaults to 0.1.</li>
  220. </ul>
  221. </td>
  222. </tr>
  223. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The estimated median of the series.</p>
  224. </td>
  225. </tr>
  226. </tbody>
  227. </table>
  228. </dd></dl>
  229. <dl class="function">
  230. <dt id="pypdevsbbl.extra.mathutils.histogram">
  231. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">histogram</code><span class="sig-paren">(</span><em>series: list</em>, <em>b: int</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#histogram"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.histogram" title="Permalink to this definition">¶</a></dt>
  232. <dd><p>Computes a b-cell histogram estimate of the series.</p>
  233. <p>Loops throughout the series and plots an estimate for
  234. a b+1 point histogram, using b equiprobable cells.
  235. When there are less then b observations, the series
  236. itself becomes the histogram.</p>
  237. <p>The source for this algorithm is based upon the
  238. <em>P^2 Algorithm for Dynamic Calculation of Quantiles
  239. and Histograms without Scoring Observations</em> by <cite>Raj
  240. Jain</cite> and <cite>Imrich Chlamtac</cite> at the Washington University
  241. in Saint Louis, 1985.</p>
  242. <div class="admonition seealso">
  243. <p class="first admonition-title">See also</p>
  244. <ul class="last simple">
  245. <li><a class="reference external" href="https://www.cse.wustl.edu/~jain/papers/ftp/psqr.pdf">https://www.cse.wustl.edu/~jain/papers/ftp/psqr.pdf</a> (paper)</li>
  246. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.histostep" title="pypdevsbbl.extra.mathutils.histostep"><code class="xref py py-meth docutils literal notranslate"><span class="pre">histostep()</span></code></a></li>
  247. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.PPP" title="pypdevsbbl.extra.mathutils.PPP"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PPP()</span></code></a></li>
  248. </ul>
  249. </div>
  250. <table class="docutils field-list" frame="void" rules="none">
  251. <col class="field-name" />
  252. <col class="field-body" />
  253. <tbody valign="top">
  254. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  255. <li><strong>series</strong> (<em>list</em>) – The series of which to compute the
  256. histogram.</li>
  257. <li><strong>b</strong> (<em>int</em>) – The amount of cells to compute.
  258. Note that b+1 will identify the amount
  259. of ‘bars’ in the histogram.</li>
  260. </ul>
  261. </td>
  262. </tr>
  263. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An (x, y) tuple where x contains the x-locations of all
  264. values on the x-axis of the histogram and y contains all
  265. heights of all bars. Both x and y are lists of numbers of
  266. size b+1.</p>
  267. </td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. </dd></dl>
  272. <dl class="function">
  273. <dt id="pypdevsbbl.extra.mathutils.histostep">
  274. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">histostep</code><span class="sig-paren">(</span><em>xj</em>, <em>b: int</em>, <em>q: list</em>, <em>n: list</em>, <em>N: int</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#histostep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.histostep" title="Permalink to this definition">¶</a></dt>
  275. <dd><p>Helper function for the histogram function.</p>
  276. <p>This function was extracted to make it easier for the algorithm
  277. to be used without knowledge of the entire series.</p>
  278. <div class="admonition seealso">
  279. <p class="first admonition-title">See also</p>
  280. <ul class="last simple">
  281. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.histogram" title="pypdevsbbl.extra.mathutils.histogram"><code class="xref py py-meth docutils literal notranslate"><span class="pre">histogram()</span></code></a></li>
  282. <li><a class="reference internal" href="#pypdevsbbl.extra.mathutils.PPP" title="pypdevsbbl.extra.mathutils.PPP"><code class="xref py py-meth docutils literal notranslate"><span class="pre">PPP()</span></code></a></li>
  283. </ul>
  284. </div>
  285. <table class="docutils field-list" frame="void" rules="none">
  286. <col class="field-name" />
  287. <col class="field-body" />
  288. <tbody valign="top">
  289. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  290. <li><strong>xj</strong> (<em>numeric</em>) – The new item in the series.</li>
  291. <li><strong>b</strong> (<em>int</em>) – The amount of cells to compute.</li>
  292. <li><strong>q</strong> (<em>list</em>) – The datavalues of the bars in the histogram.</li>
  293. <li><strong>n</strong> (<em>list</em>) – The positions of the bars in the histogram.</li>
  294. <li><strong>N</strong> (<em>int</em>) – The current observation index.</li>
  295. </ul>
  296. </td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. </dd></dl>
  301. <dl class="function">
  302. <dt id="pypdevsbbl.extra.mathutils.PPP">
  303. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">PPP</code><span class="sig-paren">(</span><em>q: list</em>, <em>n: list</em>, <em>i: int</em>, <em>d=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#PPP"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.PPP" title="Permalink to this definition">¶</a></dt>
  304. <dd><p>Do a Piecewise-Parabolic Prediction.</p>
  305. <p>Assume we have a parabola passing through
  306. (n[i-1], q[i-1]), (n[i], q[i]) and (n[i+1], q[i+1])
  307. which is of the form</p>
  308. <div class="math notranslate nohighlight">
  309. \[y = ax^2 + bx + c\]</div>
  310. <p>where (x, y) are coordinates in these points.
  311. The interpolated value (prediction) at location i can
  312. be determined via solving the equations set above.</p>
  313. <p>Based upon the PP-algorithm from
  314. <a class="reference external" href="https://www.cse.wustl.edu/~jain/papers/ftp/psqr.pdf">https://www.cse.wustl.edu/~jain/papers/ftp/psqr.pdf</a></p>
  315. <table class="docutils field-list" frame="void" rules="none">
  316. <col class="field-name" />
  317. <col class="field-body" />
  318. <tbody valign="top">
  319. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  320. <li><strong>q</strong> (<em>list</em>) – The heights of the points.</li>
  321. <li><strong>n</strong> (<em>list</em>) – The location of the points.</li>
  322. <li><strong>i</strong> (<em>int</em>) – The index where we will look.</li>
  323. <li><strong>d</strong> (<em>int</em>) – Either -1 (left) or 1 (right)</li>
  324. </ul>
  325. </td>
  326. </tr>
  327. </tbody>
  328. </table>
  329. </dd></dl>
  330. <dl class="function">
  331. <dt id="pypdevsbbl.extra.mathutils.linear_interpolation">
  332. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">linear_interpolation</code><span class="sig-paren">(</span><em>x</em>, <em>data: list</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#linear_interpolation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.linear_interpolation" title="Permalink to this definition">¶</a></dt>
  333. <dd><p>Compute the linear interpolation.</p>
  334. <p>Using the data, it will compute the value that should appear at index idx.
  335. This function will do a linear interpolation between the datapoints
  336. i-1 and i around x. (Whereas i-1=floor(x) and i=ceil(x).)
  337. We assume the line through these points follows the equation</p>
  338. <div class="math notranslate nohighlight">
  339. \[\begin{split}y &amp;= mx + q \\
  340. y - y1 &amp;= (y2 - y1) / (x2 - x1) * (x - x1)\end{split}\]</div>
  341. <table class="docutils field-list" frame="void" rules="none">
  342. <col class="field-name" />
  343. <col class="field-body" />
  344. <tbody valign="top">
  345. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  346. <li><strong>x</strong> (<em>numeric</em>) – The location to do the interpolation at. (the x-value)</li>
  347. <li><strong>data</strong> (<em>list</em>) – The list of y-values at integer values.</li>
  348. </ul>
  349. </td>
  350. </tr>
  351. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The value that corresponds with the idx in the list.</p>
  352. </td>
  353. </tr>
  354. </tbody>
  355. </table>
  356. </dd></dl>
  357. <dl class="function">
  358. <dt id="pypdevsbbl.extra.mathutils.sign">
  359. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">sign</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.sign" title="Permalink to this definition">¶</a></dt>
  360. <dd><p>Apply the sign function.</p>
  361. <table class="docutils field-list" frame="void" rules="none">
  362. <col class="field-name" />
  363. <col class="field-body" />
  364. <tbody valign="top">
  365. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>num</strong> (<em>numeric</em>) – The value of which the sign needs to be determined.</td>
  366. </tr>
  367. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><span class="math notranslate nohighlight">\(\begin{cases}\begin{align}&amp;1&amp;\textrm{if num &gt; 0}\\&amp;-1&amp;\textrm{if num &lt; 0}\\&amp;0&amp;\textrm{otherwise }\end{align}\end{cases}\)</span></td>
  368. </tr>
  369. </tbody>
  370. </table>
  371. </dd></dl>
  372. <dl class="function">
  373. <dt id="pypdevsbbl.extra.mathutils.binomial">
  374. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">binomial</code><span class="sig-paren">(</span><em>n</em>, <em>k</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#binomial"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.binomial" title="Permalink to this definition">¶</a></dt>
  375. <dd><p>The binomial computation.</p>
  376. <p>The amount of possible ways to choose k out of n.
  377. This is the computation of the binomial coefficient C(n, k).
  378. Instead of the basic formula of <code class="docutils literal notranslate"><span class="pre">n!</span> <span class="pre">/</span> <span class="pre">(k!</span> <span class="pre">*</span> <span class="pre">(n</span> <span class="pre">-</span> <span class="pre">k)!)</span></code>
  379. where ‘x!’ stands for ‘x factorial’, this method will try and
  380. compute a space-efficient binomial (i.e. O(1)).</p>
  381. <p>It is based on the explanation on:
  382. <a class="reference external" href="https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coefficient/">https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coefficient/</a></p>
  383. <table class="docutils field-list" frame="void" rules="none">
  384. <col class="field-name" />
  385. <col class="field-body" />
  386. <tbody valign="top">
  387. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  388. <li><strong>n</strong> (<em>numeric</em>) – The total number (top number).</li>
  389. <li><strong>k</strong> (<em>numeric</em>) – The amount to choose (bottom number).</li>
  390. </ul>
  391. </td>
  392. </tr>
  393. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The binomial of (n k).</p>
  394. </td>
  395. </tr>
  396. </tbody>
  397. </table>
  398. </dd></dl>
  399. <dl class="function">
  400. <dt id="pypdevsbbl.extra.mathutils.binprob">
  401. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">binprob</code><span class="sig-paren">(</span><em>t</em>, <em>n</em>, <em>p</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#binprob"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.binprob" title="Permalink to this definition">¶</a></dt>
  402. <dd><p>Compute the probability w.r.t. a binomial distribution.</p>
  403. <p>Assume X follows a discrete binomial distribution with size n
  404. and probability p: X ~ Bin(n, p)</p>
  405. <table class="docutils field-list" frame="void" rules="none">
  406. <col class="field-name" />
  407. <col class="field-body" />
  408. <tbody valign="top">
  409. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  410. <li><strong>t</strong> (<em>numeric</em>) – The value to compute.</li>
  411. <li><strong>n</strong> (<em>numeric</em>) – The size of the distribution.</li>
  412. <li><strong>p</strong> (<em>float</em>) – The probability of the distribution.</li>
  413. </ul>
  414. </td>
  415. </tr>
  416. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Pr[X &lt;= t]</p>
  417. </td>
  418. </tr>
  419. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">The probability that X is less then t</p>
  420. </td>
  421. </tr>
  422. </tbody>
  423. </table>
  424. </dd></dl>
  425. <dl class="function">
  426. <dt id="pypdevsbbl.extra.mathutils.draw_boxplot">
  427. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">draw_boxplot</code><span class="sig-paren">(</span><em>minimum</em>, <em>Q1</em>, <em>median</em>, <em>Q3</em>, <em>maximum</em>, <em>outliers=False</em>, <em>labels=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#draw_boxplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.draw_boxplot" title="Permalink to this definition">¶</a></dt>
  428. <dd><p>Get a boxplot-data object in matplotlib, based on its values.</p>
  429. <p>Using this function, it is possible to quickly draw a boxplot, based on
  430. its internal values. By default, matplotlib uses either bootstrapping or
  431. Gaussian-based asymptotic approximation (Tukey).</p>
  432. <p>This function therefore allows drawing boxplots based on other algorithms,
  433. but it does NOT draw the boxplots themselves. It yields a mere object, which
  434. can be used in the Axes.bpx method of matplotlib.</p>
  435. <table class="docutils field-list" frame="void" rules="none">
  436. <col class="field-name" />
  437. <col class="field-body" />
  438. <tbody valign="top">
  439. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  440. <li><strong>minimum</strong> (<em>numeric</em>) – The smallest number to be drawn on the boxplot.</li>
  441. <li><strong>Q1</strong> (<em>numeric</em>) – The lower quartile edge of the box.</li>
  442. <li><strong>median</strong> (<em>numeric</em>) – The median position indicator in the box.</li>
  443. <li><strong>Q3</strong> (<em>numeric</em>) – The upper quartile edge of the box.</li>
  444. <li><strong>maximum</strong> (<em>numeric</em>) – The largest number to be drawn on the boxplot.</li>
  445. <li><strong>outliers</strong> (<em>bool</em>) – When true, this will make sure the whiskers are at most
  446. 1.5 * IQR away from the box. If the <cite>minimum</cite> and the
  447. <cite>maximum</cite> are outside of this range, they will be
  448. indicated as outliers.
  449. Do note that, as was the case with the compute_boxplot
  450. function, this method is a mere approximation of the
  451. boxplot, which becomes clear when comparing it to the
  452. actual boxplot. Theoretically, it’s a good approximation
  453. nonetheless.
  454. Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</li>
  455. <li><strong>labels</strong> (<em>iterable</em>) – Labels for each dataset.
  456. See also cbook.boxplot_stats.labels</li>
  457. </ul>
  458. </td>
  459. </tr>
  460. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><p>A dictionary containing the results for each column of data.
  461. This is basically a transformed dictionary, based on:</p>
  462. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cbook</span><span class="o">.</span><span class="n">boxplot_stats</span><span class="p">([</span><span class="n">minimum</span><span class="p">,</span> <span class="n">Q1</span><span class="p">,</span> <span class="n">median</span><span class="p">,</span> <span class="n">Q3</span><span class="p">,</span> <span class="n">maximum</span><span class="p">],</span> <span class="n">labels</span><span class="o">=</span><span class="n">labels</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
  463. </pre></div>
  464. </div>
  465. </p>
  466. </td>
  467. </tr>
  468. </tbody>
  469. </table>
  470. <p class="rubric">Example</p>
  471. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
  472. <span class="go">&gt;&gt;&gt;</span>
  473. <span class="gp">&gt;&gt;&gt; </span><span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">()</span>
  474. <span class="gp">&gt;&gt;&gt; </span><span class="n">boxplot</span> <span class="o">=</span> <span class="n">draw_boxplot</span><span class="p">(</span><span class="n">minimum</span><span class="p">,</span> <span class="n">Q1</span><span class="p">,</span> <span class="n">median</span><span class="p">,</span> <span class="n">Q3</span><span class="p">,</span> <span class="n">maximum</span><span class="p">)</span>
  475. <span class="gp">&gt;&gt;&gt; </span><span class="n">ax</span><span class="o">.</span><span class="n">bpx</span><span class="p">(</span><span class="n">boxplot</span><span class="p">)</span> <span class="c1"># draws the actual boxplot</span>
  476. <span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
  477. </pre></div>
  478. </div>
  479. </dd></dl>
  480. <dl class="function">
  481. <dt id="pypdevsbbl.extra.mathutils.mean">
  482. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">mean</code><span class="sig-paren">(</span><em>seq</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#mean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.mean" title="Permalink to this definition">¶</a></dt>
  483. <dd><p>Computes the mean of a sequence.</p>
  484. <table class="docutils field-list" frame="void" rules="none">
  485. <col class="field-name" />
  486. <col class="field-body" />
  487. <tbody valign="top">
  488. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seq</strong> (<em>iterable</em>) – The sequence to compute the mean for.</td>
  489. </tr>
  490. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The mean of the sequence.</td>
  491. </tr>
  492. </tbody>
  493. </table>
  494. </dd></dl>
  495. <dl class="function">
  496. <dt id="pypdevsbbl.extra.mathutils.var">
  497. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">var</code><span class="sig-paren">(</span><em>seq</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#var"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.var" title="Permalink to this definition">¶</a></dt>
  498. <dd><p>Computes the variance of a sequence.</p>
  499. <table class="docutils field-list" frame="void" rules="none">
  500. <col class="field-name" />
  501. <col class="field-body" />
  502. <tbody valign="top">
  503. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seq</strong> (<em>iterable</em>) – The sequence to compute the variance for.</td>
  504. </tr>
  505. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The variance of the sequence.</td>
  506. </tr>
  507. </tbody>
  508. </table>
  509. </dd></dl>
  510. <dl class="function">
  511. <dt id="pypdevsbbl.extra.mathutils.std">
  512. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">std</code><span class="sig-paren">(</span><em>seq</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#std"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.std" title="Permalink to this definition">¶</a></dt>
  513. <dd><p>Computes the standard derivation of a sequence.</p>
  514. <table class="docutils field-list" frame="void" rules="none">
  515. <col class="field-name" />
  516. <col class="field-body" />
  517. <tbody valign="top">
  518. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>seq</strong> (<em>iterable</em>) – The sequence to compute the standard
  519. derivation for.</td>
  520. </tr>
  521. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The standard derivation of the sequence.</td>
  522. </tr>
  523. </tbody>
  524. </table>
  525. </dd></dl>
  526. <dl class="function">
  527. <dt id="pypdevsbbl.extra.mathutils.harmonic">
  528. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">harmonic</code><span class="sig-paren">(</span><em>n: int</em>, <em>m=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#harmonic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.harmonic" title="Permalink to this definition">¶</a></dt>
  529. <dd><p>Computes the n-th generalized harmonic number.</p>
  530. <table class="docutils field-list" frame="void" rules="none">
  531. <col class="field-name" />
  532. <col class="field-body" />
  533. <tbody valign="top">
  534. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  535. <li><strong>n</strong> (<em>int</em>) – The number to obtain.</li>
  536. <li><strong>m</strong> (<em>numeric</em>) – The power of each denominator.
  537. Defaults to 1, which also allows non-generalized numbers.</li>
  538. </ul>
  539. </td>
  540. </tr>
  541. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The n-th generalized harmonic number.</p>
  542. </td>
  543. </tr>
  544. </tbody>
  545. </table>
  546. </dd></dl>
  547. <dl class="function">
  548. <dt id="pypdevsbbl.extra.mathutils.harmonicinv">
  549. <code class="descclassname">pypdevsbbl.extra.mathutils.</code><code class="descname">harmonicinv</code><span class="sig-paren">(</span><em>y</em>, <em>m=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/mathutils.html#harmonicinv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.mathutils.harmonicinv" title="Permalink to this definition">¶</a></dt>
  550. <dd><p>Compute the inverse general harmonic number.</p>
  551. <p>I.e. <span class="math notranslate nohighlight">\(GH(n, m) = y \iff IH(y, m) = n\)</span></p>
  552. <table class="docutils field-list" frame="void" rules="none">
  553. <col class="field-name" />
  554. <col class="field-body" />
  555. <tbody valign="top">
  556. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  557. <li><strong>y</strong> (<em>numeric</em>) – The general harmonic number.</li>
  558. <li><strong>m</strong> (<em>numeric</em>) – The power to compute.
  559. Defaults to 1.</li>
  560. </ul>
  561. </td>
  562. </tr>
  563. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The inverse general harmonic number.</p>
  564. </td>
  565. </tr>
  566. </tbody>
  567. </table>
  568. </dd></dl>
  569. </div>
  570. </div>
  571. </div>
  572. </div>
  573. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  574. <div class="sphinxsidebarwrapper">
  575. <h4>Previous topic</h4>
  576. <p class="topless"><a href="pypdevsbbl.extra.heap.html"
  577. title="previous chapter">pypdevsbbl.extra.heap module</a></p>
  578. <h4>Next topic</h4>
  579. <p class="topless"><a href="pypdevsbbl.extra.packaging.html"
  580. title="next chapter">pypdevsbbl.extra.packaging module</a></p>
  581. <div id="searchbox" style="display: none" role="search">
  582. <h3>Quick search</h3>
  583. <div class="searchformwrapper">
  584. <form class="search" action="search.html" method="get">
  585. <input type="text" name="q" />
  586. <input type="submit" value="Go" />
  587. <input type="hidden" name="check_keywords" value="yes" />
  588. <input type="hidden" name="area" value="default" />
  589. </form>
  590. </div>
  591. </div>
  592. <script type="text/javascript">$('#searchbox').show(0);</script>
  593. </div>
  594. </div>
  595. <div class="clearer"></div>
  596. </div>
  597. <div class="related" role="navigation" aria-label="related navigation">
  598. <h3>Navigation</h3>
  599. <ul>
  600. <li class="right" style="margin-right: 10px">
  601. <a href="genindex.html" title="General Index"
  602. >index</a></li>
  603. <li class="right" >
  604. <a href="py-modindex.html" title="Python Module Index"
  605. >modules</a> |</li>
  606. <li class="right" >
  607. <a href="pypdevsbbl.extra.packaging.html" title="pypdevsbbl.extra.packaging module"
  608. >next</a> |</li>
  609. <li class="right" >
  610. <a href="pypdevsbbl.extra.heap.html" title="pypdevsbbl.extra.heap module"
  611. >previous</a> |</li>
  612. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  613. <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> &#187;</li>
  614. <li class="nav-item nav-item-2"><a href="pypdevsbbl.extra.html" >pypdevsbbl.extra package</a> &#187;</li>
  615. </ul>
  616. </div>
  617. <div class="footer" role="contentinfo">
  618. &#169; Copyright 2020, Randy Paredis.
  619. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
  620. </div>
  621. </body>
  622. </html>