|
|
@ -470,7 +470,7 @@ Point(x=<span class="hljs-number">1</span>, y=<span class="hljs-number">2</span> |
|
|
|
<div><h3 id="statistics">Statistics</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> statistics <span class="hljs-keyword">import</span> mean, median, variance <span class="hljs-comment"># Also: stdev, quantiles, groupby.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
<div><h3 id="random">Random</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> random <span class="hljs-keyword">import</span> random, randint, choice <span class="hljs-comment"># Also shuffle, gauss, triangular, seed.</span> |
|
|
|
<div><h3 id="random">Random</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> random <span class="hljs-keyword">import</span> random, randint, choice <span class="hljs-comment"># Also: shuffle, gauss, triangular, seed.</span> |
|
|
|
<float> = random() <span class="hljs-comment"># A float inside [0, 1).</span> |
|
|
|
<int> = randint(from_inc, to_inc) <span class="hljs-comment"># An int inside [from_inc, to_inc].</span> |
|
|
|
<el> = choice(<sequence>) <span class="hljs-comment"># Keeps the sequence intact.</span> |
|
|
|