j1-template 2022.4.2 → 2022.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  3. data/assets/themes/j1/modules/vega/js/vega-lite/README.md +0 -13
  4. data/lib/j1/version.rb +1 -1
  5. data/lib/starter_web/Gemfile +1 -1
  6. data/lib/starter_web/_config.yml +1 -1
  7. data/lib/starter_web/_data/modules/defaults/nbinteract.yml +1 -1
  8. data/lib/starter_web/_data/modules/navigator_menu.yml +60 -73
  9. data/lib/starter_web/_data/modules/nbinteract.yml +291 -314
  10. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  11. data/lib/starter_web/assets/images/modules/attics/shubham-dhage-2-1920x1280.jpg +0 -0
  12. data/lib/starter_web/package.json +1 -1
  13. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_interactive.html +2216 -0
  14. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_non_interactive.html +1170 -0
  15. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_01_basic_plotting.html +1479 -0
  16. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_02_styling_and_theming.html +1524 -0
  17. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_03_data_sources_and_transformations.html +983 -0
  18. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_04_adding_annotations.html +1280 -0
  19. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_05_presentation_layouts.html +660 -0
  20. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_06_linking_and_interactions.html +1563 -0
  21. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_07_bar_and_categorical_data_plots.html +1888 -0
  22. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_08_graph_and_network_plots.html +689 -0
  23. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_09_geographic_plots.html +767 -0
  24. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_circular_times_table.html +2 -1
  25. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html +21 -0
  26. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  27. data/lib/starter_web/utilsrv/package.json +1 -1
  28. metadata +14 -14
  29. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_central_limit_theorem.html +0 -290
  30. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_correlation.html +0 -818
  31. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_empirical_distributions.html +0 -351
  32. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_linear_regression.html +0 -106
  33. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_probability_distribution_plots.html +0 -228
  34. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_sampling_from_a_population.html +0 -518
  35. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_variability_of_the_sample_mean.html +0 -372
  36. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_graphing.html +0 -473
  37. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_interactive_questions.html +0 -242
  38. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_layout.html +0 -496
  39. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_interact.html +0 -329
  40. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_monty_hall.html +0 -866
@@ -52,7 +52,8 @@
52
52
  <iframe
53
53
  width="900" height="540"
54
54
  frameborder="0" allowfullscreen
55
- src="https://www.youtube.com/embed/qhbuKbxJsk8"></iframe>
55
+ src="https://www.youtube.com/embed/qhbuKbxJsk8">
56
+ </iframe>
56
57
  </center>
57
58
 
58
59
  </div>
@@ -34,6 +34,27 @@ and can visualize changes in the data.</p>
34
34
  </pre></div>
35
35
 
36
36
  </div>
37
+ </div>
38
+ </div>
39
+
40
+ <div class="output_wrapper">
41
+ <div class="output">
42
+
43
+
44
+ <div class="output_area">
45
+
46
+
47
+
48
+ <div class="output_subarea output_text output_error">
49
+ <pre>
50
+ <span class="ansi-cyan-intense-fg ansi-bold"> File </span><span class="ansi-green-intense-fg ansi-bold">&#34;&lt;ipython-input-2-6d5abc7d33bf&gt;&#34;</span><span class="ansi-cyan-intense-fg ansi-bold">, line </span><span class="ansi-green-intense-fg ansi-bold">4</span>
51
+ <span class="ansi-yellow-intense-fg ansi-bold"> import &#34;j1-nbinteract&#34; as nbi</span>
52
+ <span class="ansi-white-intense-fg ansi-bold"> ^</span>
53
+ <span class="ansi-red-intense-fg ansi-bold">SyntaxError</span><span class="ansi-red-intense-fg ansi-bold">:</span> invalid syntax
54
+ </pre>
55
+ </div>
56
+ </div>
57
+
37
58
  </div>
38
59
  </div>
39
60
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": true,
3
3
  "name": "utls",
4
- "version": "2022.4.2",
4
+ "version": "2022.4.3",
5
5
  "description": "J1 Template Utility Server",
6
6
  "homepage": "https://jekyll.one",
7
7
  "author": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": true,
3
3
  "name": "utls",
4
- "version": "2022.4.2",
4
+ "version": "2022.4.3",
5
5
  "description": "J1 Template Utility Server",
6
6
  "homepage": "https://jekyll.one",
7
7
  "author": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: j1-template
3
3
  version: !ruby/object:Gem::Version
4
- version: 2022.4.2
4
+ version: 2022.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - juergen_jekyll_one
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -1857,6 +1857,7 @@ files:
1857
1857
  - lib/starter_web/assets/images/modules/attics/rirri-1920x1280.jpg
1858
1858
  - lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg
1859
1859
  - lib/starter_web/assets/images/modules/attics/runner-1920x1200.jpg
1860
+ - lib/starter_web/assets/images/modules/attics/shubham-dhage-2-1920x1280.jpg
1860
1861
  - lib/starter_web/assets/images/modules/attics/sigmund-1920x1280.jpg
1861
1862
  - lib/starter_web/assets/images/modules/attics/szabo-viktor-1920x1280.jpg
1862
1863
  - lib/starter_web/assets/images/modules/attics/tldr-1920x800.jpg
@@ -2178,23 +2179,22 @@ files:
2178
2179
  - lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_recipes_layout.ipynb
2179
2180
  - lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_tutorial_interact.ipynb
2180
2181
  - lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_tutorial_monty_hall.ipynb
2182
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_interactive.html
2183
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_non_interactive.html
2184
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_01_basic_plotting.html
2185
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_02_styling_and_theming.html
2186
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_03_data_sources_and_transformations.html
2187
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_04_adding_annotations.html
2188
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_05_presentation_layouts.html
2189
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_06_linking_and_interactions.html
2190
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_07_bar_and_categorical_data_plots.html
2191
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_08_graph_and_network_plots.html
2192
+ - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_09_geographic_plots.html
2181
2193
  - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_circular_times_table.html
2182
2194
  - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_climate_change_forecast.html
2183
2195
  - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_docs_example_dynamic.html
2184
2196
  - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html
2185
2197
  - lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_odes_in_python.html
2186
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_central_limit_theorem.html
2187
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_correlation.html
2188
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_empirical_distributions.html
2189
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_linear_regression.html
2190
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_probability_distribution_plots.html
2191
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_sampling_from_a_population.html
2192
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_variability_of_the_sample_mean.html
2193
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_graphing.html
2194
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_interactive_questions.html
2195
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_layout.html
2196
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_interact.html
2197
- - lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_monty_hall.html
2198
2198
  - lib/starter_web/pages/public/jupyter/where_to_go.adoc
2199
2199
  - lib/starter_web/pages/public/learn/quickstart.adoc
2200
2200
  - lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc
@@ -1,290 +0,0 @@
1
- <div class="cell text_cell">
2
- <button class="js-nbinteract-widget">
3
- Loading widgets...
4
- </button>
5
- </div>
6
-
7
-
8
-
9
-
10
-
11
-
12
- <div class="nbinteract-hide_in
13
- cell border-box-sizing code_cell rendered">
14
- <div class="input">
15
-
16
- <div class="inner_cell">
17
- <div class="input_area">
18
- <div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># HIDDEN</span>
19
- <span class="kn">from</span> <span class="nn">datascience</span> <span class="kn">import</span> <span class="o">*</span>
20
- <span class="o">%</span><span class="k">matplotlib</span> inline
21
- <span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plots</span>
22
- <span class="n">plots</span><span class="o">.</span><span class="n">style</span><span class="o">.</span><span class="n">use</span><span class="p">(</span><span class="s1">&#39;fivethirtyeight&#39;</span><span class="p">)</span>
23
- <span class="kn">import</span> <span class="nn">math</span>
24
- <span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
25
- <span class="kn">from</span> <span class="nn">scipy</span> <span class="kn">import</span> <span class="n">stats</span>
26
- <span class="kn">import</span> <span class="nn">ipywidgets</span> <span class="k">as</span> <span class="nn">widgets</span>
27
- <span class="kn">import</span> <span class="nn">nbinteract</span> <span class="k">as</span> <span class="nn">nbi</span>
28
- </pre></div>
29
-
30
- </div>
31
- </div>
32
- </div>
33
-
34
- </div>
35
- <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
36
- <div class="text_cell_render border-box-sizing rendered_html">
37
- <h3 id="The-Central-Limit-Theorem">The Central Limit Theorem<a class="anchor-link" href="#The-Central-Limit-Theorem">&#182;</a></h3><p>Very few of the data histograms that we have seen in this course have been bell shaped.
38
- When we have come across a bell shaped distribution, it has almost invariably been an
39
- empirical histogram of a statistic based on a random sample.</p>
40
-
41
- </div>
42
- </div>
43
- </div>
44
- <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
45
- <div class="text_cell_render border-box-sizing rendered_html">
46
- <p><strong>The Central Limit Theorem says that the probability distribution of the sum or average of a large random sample drawn with replacement will be roughly normal, <em>regardless of the distribution of the population from which the sample is drawn</em>.</strong></p>
47
- <p>As we noted when we were studying Chebychev's bounds, results that can be applied to random samples <em>regardless of the distribution of the population</em> are very powerful, because in data science we rarely know the distribution of the population.</p>
48
- <p>The Central Limit Theorem makes it possible to make inferences with very little knowledge about the population, provided we have a large random sample. That is why it is central to the field of statistical inference.</p>
49
-
50
- </div>
51
- </div>
52
- </div>
53
- <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
54
- <div class="text_cell_render border-box-sizing rendered_html">
55
- <h4 id="Proportion-of-Purple-Flowers">Proportion of Purple Flowers<a class="anchor-link" href="#Proportion-of-Purple-Flowers">&#182;</a></h4><p>Recall Mendel's probability model for the colors of the flowers of a species of pea plant. The model says that the flower colors of the plants are like draws made at random with replacement from {Purple, Purple, Purple, White}.</p>
56
- <p>In a large sample of plants, about what proportion will have purple flowers? We would expect the answer to be about 0.75, the proportion purple in the model. And, because proportions are means, the Central Limit Theorem says that the distribution of the sample proportion of purple plants is roughly normal.</p>
57
- <p>We can confirm this by simulation. Let's simulate the proportion of purple-flowered plants in a sample of 200 plants.</p>
58
-
59
- </div>
60
- </div>
61
- </div>
62
-
63
-
64
-
65
- <div class="
66
- cell border-box-sizing code_cell rendered">
67
- <div class="input">
68
-
69
- <div class="inner_cell">
70
- <div class="input_area">
71
- <div class=" highlight hl-ipython3"><pre><span></span><span class="n">colors</span> <span class="o">=</span> <span class="n">make_array</span><span class="p">(</span><span class="s1">&#39;Purple&#39;</span><span class="p">,</span> <span class="s1">&#39;Purple&#39;</span><span class="p">,</span> <span class="s1">&#39;Purple&#39;</span><span class="p">,</span> <span class="s1">&#39;White&#39;</span><span class="p">)</span>
72
-
73
- <span class="n">model</span> <span class="o">=</span> <span class="n">Table</span><span class="p">()</span><span class="o">.</span><span class="n">with_column</span><span class="p">(</span><span class="s1">&#39;Color&#39;</span><span class="p">,</span> <span class="n">colors</span><span class="p">)</span>
74
-
75
- <span class="n">model</span>
76
- </pre></div>
77
-
78
- </div>
79
- </div>
80
- </div>
81
-
82
- <div class="output_wrapper">
83
- <div class="output">
84
-
85
-
86
- <div class="output_area">
87
-
88
-
89
-
90
-
91
- <div class="output_html rendered_html output_subarea output_execute_result">
92
- <table border="1" class="dataframe">
93
- <thead>
94
- <tr>
95
- <th>Color</th>
96
- </tr>
97
- </thead>
98
- <tbody>
99
- <tr>
100
- <td>Purple</td>
101
- </tr>
102
- <tr>
103
- <td>Purple</td>
104
- </tr>
105
- <tr>
106
- <td>Purple</td>
107
- </tr>
108
- <tr>
109
- <td>White </td>
110
- </tr>
111
- </tbody>
112
- </table>
113
- </div>
114
-
115
- </div>
116
-
117
- </div>
118
- </div>
119
-
120
- </div>
121
-
122
-
123
-
124
- <div class="
125
- cell border-box-sizing code_cell rendered">
126
- <div class="input">
127
-
128
- <div class="inner_cell">
129
- <div class="input_area">
130
- <div class=" highlight hl-ipython3"><pre><span></span><span class="n">props</span> <span class="o">=</span> <span class="n">make_array</span><span class="p">()</span>
131
-
132
- <span class="n">num_plants</span> <span class="o">=</span> <span class="mi">200</span>
133
- <span class="n">repetitions</span> <span class="o">=</span> <span class="mi">1000</span>
134
-
135
- <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">repetitions</span><span class="p">):</span>
136
- <span class="n">sample</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">sample</span><span class="p">(</span><span class="n">num_plants</span><span class="p">)</span>
137
- <span class="n">new_prop</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">count_nonzero</span><span class="p">(</span><span class="n">sample</span><span class="o">.</span><span class="n">column</span><span class="p">(</span><span class="s1">&#39;Color&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;Purple&#39;</span><span class="p">)</span><span class="o">/</span><span class="n">num_plants</span>
138
- <span class="n">props</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">props</span><span class="p">,</span> <span class="n">new_prop</span><span class="p">)</span>
139
- <span class="n">props</span><span class="p">[:</span><span class="mi">5</span><span class="p">]</span>
140
- </pre></div>
141
-
142
- </div>
143
- </div>
144
- </div>
145
-
146
- <div class="output_wrapper">
147
- <div class="output">
148
-
149
-
150
- <div class="output_area">
151
-
152
-
153
-
154
-
155
-
156
- <div class="output_text output_subarea output_execute_result">
157
- <pre>array([0.765, 0.695, 0.69 , 0.76 , 0.78 ])</pre>
158
- </div>
159
-
160
- </div>
161
-
162
- </div>
163
- </div>
164
-
165
- </div>
166
-
167
-
168
-
169
- <div class="
170
- cell border-box-sizing code_cell rendered">
171
- <div class="input">
172
-
173
- <div class="inner_cell">
174
- <div class="input_area">
175
- <div class=" highlight hl-ipython3"><pre><span></span><span class="n">opts</span> <span class="o">=</span> <span class="p">{</span>
176
- <span class="s1">&#39;title&#39;</span><span class="p">:</span> <span class="s1">&#39;Distribution of sample proportions&#39;</span><span class="p">,</span>
177
- <span class="s1">&#39;xlabel&#39;</span><span class="p">:</span> <span class="s1">&#39;Sample Proportion&#39;</span><span class="p">,</span>
178
- <span class="s1">&#39;ylabel&#39;</span><span class="p">:</span> <span class="s1">&#39;Percent per unit&#39;</span><span class="p">,</span>
179
- <span class="s1">&#39;xlim&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mf">0.64</span><span class="p">,</span> <span class="mf">0.84</span><span class="p">),</span>
180
- <span class="s1">&#39;ylim&#39;</span><span class="p">:</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">25</span><span class="p">),</span>
181
- <span class="s1">&#39;bins&#39;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
182
- <span class="p">}</span>
183
- <span class="n">nbi</span><span class="o">.</span><span class="n">hist</span><span class="p">(</span><span class="n">props</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="n">opts</span><span class="p">)</span>
184
- </pre></div>
185
-
186
- </div>
187
- </div>
188
- </div>
189
-
190
- <div class="output_wrapper">
191
- <div class="output">
192
-
193
-
194
- <div class="output_area">
195
-
196
-
197
-
198
-
199
-
200
- <div class="output_subarea output_widget_view ">
201
- <button class="js-nbinteract-widget">
202
- Loading widgets...
203
- </button>
204
- </div>
205
-
206
- </div>
207
-
208
- </div>
209
- </div>
210
-
211
- </div>
212
- <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
213
- <div class="text_cell_render border-box-sizing rendered_html">
214
- <p>There's that normal curve again, as predicted by the Central Limit Theorem, centered at around 0.75 just as you would expect.</p>
215
- <p>How would this distribution change if we increased the sample size? We can copy our sampling code into a function and then use interaction to see how the distribution changes as the sample size increases.</p>
216
- <p>We will keep the number of <code>repetitions</code> the same as before so that the two columns have the same length.</p>
217
-
218
- </div>
219
- </div>
220
- </div>
221
-
222
-
223
-
224
- <div class="
225
- cell border-box-sizing code_cell rendered">
226
- <div class="input">
227
-
228
- <div class="inner_cell">
229
- <div class="input_area">
230
- <div class=" highlight hl-ipython3"><pre><span></span><span class="k">def</span> <span class="nf">empirical_props</span><span class="p">(</span><span class="n">num_plants</span><span class="p">):</span>
231
- <span class="n">props</span> <span class="o">=</span> <span class="n">make_array</span><span class="p">()</span>
232
- <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">repetitions</span><span class="p">):</span>
233
- <span class="n">sample</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">sample</span><span class="p">(</span><span class="n">num_plants</span><span class="p">)</span>
234
- <span class="n">new_prop</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">count_nonzero</span><span class="p">(</span><span class="n">sample</span><span class="o">.</span><span class="n">column</span><span class="p">(</span><span class="s1">&#39;Color&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="s1">&#39;Purple&#39;</span><span class="p">)</span><span class="o">/</span><span class="n">num_plants</span>
235
- <span class="n">props</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">props</span><span class="p">,</span> <span class="n">new_prop</span><span class="p">)</span>
236
- <span class="k">return</span> <span class="n">props</span>
237
- </pre></div>
238
-
239
- </div>
240
- </div>
241
- </div>
242
-
243
- </div>
244
-
245
-
246
-
247
- <div class="
248
- cell border-box-sizing code_cell rendered">
249
- <div class="input">
250
-
251
- <div class="inner_cell">
252
- <div class="input_area">
253
- <div class=" highlight hl-ipython3"><pre><span></span><span class="n">nbi</span><span class="o">.</span><span class="n">hist</span><span class="p">(</span><span class="n">empirical_props</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="n">opts</span><span class="p">,</span>
254
- <span class="n">num_plants</span><span class="o">=</span><span class="n">widgets</span><span class="o">.</span><span class="n">ToggleButtons</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="p">[</span><span class="mi">100</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="mi">400</span><span class="p">,</span> <span class="mi">800</span><span class="p">]))</span>
255
- </pre></div>
256
-
257
- </div>
258
- </div>
259
- </div>
260
-
261
- <div class="output_wrapper">
262
- <div class="output">
263
-
264
-
265
- <div class="output_area">
266
-
267
-
268
-
269
-
270
-
271
- <div class="output_subarea output_widget_view ">
272
- <button class="js-nbinteract-widget">
273
- Loading widgets...
274
- </button>
275
- </div>
276
-
277
- </div>
278
-
279
- </div>
280
- </div>
281
-
282
- </div>
283
- <div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
284
- <div class="text_cell_render border-box-sizing rendered_html">
285
- <p>All of the above distributions are approximately normal but become more narrow as the sample size increases. For example, the proportions based on a sample size of 800 are more tightly clustered around 0.75 than those from a sample size of 200. Increasing the sample size has decreased the variability in the sample proportion.</p>
286
-
287
- </div>
288
- </div>
289
- </div>
290
-