Acknowledgments |
|
xvii | |
Introduction |
|
xix | |
Who Should Read This Book? |
|
xx | |
Why Python? |
|
xx | |
What's in This Book? |
|
xx | |
Python Version, Platform, and IDE |
|
xxii | |
Installing Python |
|
xxii | |
Running Python |
|
xxiv | |
Using a Virtual Environment |
|
xxv | |
Onward! |
|
xxv | |
|
1 Saving Shipwrecked Sailors With Bates' Rule |
|
|
1 | (26) |
|
|
2 | (3) |
|
Project #1 Search and Rescue |
|
|
5 | (19) |
|
|
6 | (1) |
|
Installing the Python Libraries |
|
|
6 | (1) |
|
|
6 | (16) |
|
|
22 | (2) |
|
|
24 | (1) |
|
|
24 | (1) |
|
Challenge Project: Smarter Searches |
|
|
24 | (1) |
|
Challenge Project: Finding the Best Strategy with MCS |
|
|
25 | (1) |
|
Challenge Project: Calculating the Probability of Detection |
|
|
25 | (2) |
|
2 Attributing Authorship With Stylometry |
|
|
27 | (24) |
|
Project #2 The Hound, The War, and The Lost World |
|
|
28 | (19) |
|
|
28 | (1) |
|
|
29 | (3) |
|
|
32 | (1) |
|
|
32 | (15) |
|
|
47 | (1) |
|
|
48 | (1) |
|
Practice Project: Hunting the Hound with Dispersion |
|
|
48 | (1) |
|
Practice Project: Punctuation Heatmap |
|
|
49 | (1) |
|
Challenge Project: Fixing Frequency |
|
|
50 | (1) |
|
2 Summarizing Speeches With Natural Language Processing |
|
|
51 | (26) |
|
Project #3 I Have a Dream to Summarize Speeches! |
|
|
52 | (9) |
|
|
52 | (1) |
|
|
53 | (1) |
|
The "I Have a Dream" Code |
|
|
53 | (8) |
|
Project #4 Summarizing Speeches with gensim |
|
|
61 | (3) |
|
|
61 | (1) |
|
|
61 | (3) |
|
Project #5 Summarizing Text with Word Clouds |
|
|
64 | (7) |
|
The Word Cloud and PIL Modules |
|
|
65 | (1) |
|
|
66 | (4) |
|
Fine-Tuning the Word Cloud |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
72 | (1) |
|
Challenge Project: Game Night |
|
|
72 | (1) |
|
Challenge Project: Summarizing Summaries |
|
|
73 | (1) |
|
Challenge Project: Summarizing a Novel |
|
|
74 | (1) |
|
Challenge Project: It's Not Just What You Say, It's How You Say It! |
|
|
75 | (2) |
|
4 Sending Super-Secret Messages With A Book Cipher |
|
|
77 | (18) |
|
|
78 | (2) |
|
|
80 | (1) |
|
Project #6 The Digital Key to Rebecca |
|
|
80 | (11) |
|
|
81 | (1) |
|
|
82 | (8) |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
91 | (1) |
|
Practice Project: Charting the Characters |
|
|
92 | (1) |
|
Practice Project: Sending Secrets the WWII Way |
|
|
93 | (2) |
|
|
95 | (28) |
|
Project #7 Replicating a Blink Comparator |
|
|
96 | (16) |
|
|
97 | (1) |
|
|
98 | (1) |
|
The Blink Comparator Code |
|
|
99 | (11) |
|
Using the Blink Comparator |
|
|
110 | (2) |
|
Project #8 Detecting Astronomical Transients with Image Differencing |
|
|
112 | (7) |
|
|
113 | (1) |
|
The Transient Detector Code |
|
|
113 | (6) |
|
Using the Transient Detector |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
119 | (1) |
|
Practice Project: Plotting the Orbital Path |
|
|
119 | (1) |
|
Practice Project: What's the Difference? |
|
|
120 | (1) |
|
Challenge Project: Counting Stars |
|
|
120 | (3) |
|
6 Winning The Moon Race With Apollo 8 |
|
|
123 | (28) |
|
Understanding the Apollo 8 Mission |
|
|
124 | (3) |
|
The Free Return Trajectory |
|
|
125 | (1) |
|
|
126 | (1) |
|
Project #9 To the Moon with Apollo 8! |
|
|
127 | (19) |
|
|
127 | (4) |
|
|
131 | (1) |
|
The Apollo 8 Free Return Code |
|
|
132 | (12) |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
146 | (1) |
|
Practice Project: Simulating a Search Pattern |
|
|
146 | (1) |
|
Practice Project: Start Me Up! |
|
|
147 | (1) |
|
Practice Project: Shut Me Down! |
|
|
148 | (1) |
|
Challenge Project: True-Scale Simulation |
|
|
149 | (1) |
|
Challenge Project: The Real Apollo 8 |
|
|
149 | (2) |
|
7 Selecting Martian Landing Sites |
|
|
151 | (26) |
|
|
152 | (1) |
|
|
153 | (1) |
|
Project #10 Selecting Martian Landing Sites |
|
|
153 | (18) |
|
|
154 | (1) |
|
|
155 | (15) |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
171 | (1) |
|
Practice Project: Confirming That Drawings Become Part of an Image |
|
|
172 | (1) |
|
Practice Project: Extracting an Elevation Profile |
|
|
172 | (1) |
|
Practice Project: Plotting in 3D |
|
|
173 | (1) |
|
Practice Project: Mixing Maps |
|
|
173 | (2) |
|
Challenge Project: Making It Three in a Row |
|
|
175 | (1) |
|
Challenge Project: Wrapping Rectangles |
|
|
175 | (2) |
|
8 Detecting Distant Exoplanets |
|
|
177 | (26) |
|
|
178 | (1) |
|
Project #11 Simulating an Exoplanet Transit |
|
|
179 | (9) |
|
|
180 | (1) |
|
|
181 | (5) |
|
Experimenting with Transit Photometry |
|
|
186 | (2) |
|
Project #12 Imaging Exoplanets |
|
|
188 | (6) |
|
|
188 | (1) |
|
|
189 | (5) |
|
|
194 | (1) |
|
|
194 | (1) |
|
Practice Project: Detecting Alien Megastructures |
|
|
195 | (2) |
|
Practice Project: Detecting Asteroid Transits |
|
|
197 | (1) |
|
Practice Project: Incorporating Limb Darkening |
|
|
198 | (2) |
|
Practice Project: Detecting Starspots |
|
|
200 | (1) |
|
Practice Project: Detecting an Alien Armada |
|
|
200 | (1) |
|
Practice Project: Detecting a Planet with a Moon |
|
|
201 | (1) |
|
Practice Project: Measuring the Length of an Exoplanet's Day |
|
|
201 | (1) |
|
Challenge Project: Generating a Dynamic Light Curve |
|
|
202 | (1) |
|
9 Identifying Friend Or Foe |
|
|
203 | (22) |
|
Detecting Faces in Photographs |
|
|
204 | (1) |
|
Project #13 Programming a Robot Sentry Gun |
|
|
205 | (14) |
|
|
207 | (1) |
|
|
207 | (11) |
|
|
218 | (1) |
|
Detecting Faces from a Video Stream |
|
|
219 | (2) |
|
|
221 | (1) |
|
|
222 | (1) |
|
Practice Project: Blurring Faces |
|
|
222 | (1) |
|
Challenge Project: Detecting Cat Faces |
|
|
223 | (2) |
|
10 Restricting Access With Face Recognition |
|
|
225 | (20) |
|
Recognizing Faces with Local Binary Pattern Histograms |
|
|
226 | (5) |
|
The Face Recognition Flowchart |
|
|
226 | (2) |
|
Extracting Local Binary Pattern Histograms |
|
|
228 | (3) |
|
Project #14 Restricting Access to the Alien Artifact |
|
|
231 | (11) |
|
|
231 | (1) |
|
Supporting Modules and Files |
|
|
231 | (1) |
|
|
232 | (4) |
|
|
236 | (2) |
|
|
238 | (3) |
|
|
241 | (1) |
|
|
242 | (1) |
|
|
242 | (1) |
|
Challenge Project: Adding a Password and Video Capture |
|
|
242 | (1) |
|
Challenge Project: Look-Alikes and Twins |
|
|
243 | (1) |
|
Challenge Project: Time Machine |
|
|
243 | (2) |
|
11 Creating An Interactive Zombie Escape Map |
|
|
245 | (24) |
|
Project #15 Visualizing Population Density with a Choropleth Map |
|
|
246 | (20) |
|
|
247 | (1) |
|
The Python Data Analysis Library |
|
|
248 | (1) |
|
The bokeh and holoviews Libraries |
|
|
249 | (1) |
|
Installing pandas, bokeh, and holoviews |
|
|
250 | (1) |
|
Accessing the County, State, Unemployment, and Population Data |
|
|
250 | (2) |
|
|
252 | (2) |
|
|
254 | (8) |
|
|
262 | (4) |
|
|
266 | (1) |
|
|
266 | (1) |
|
Challenge Project: Mapping US Population Change |
|
|
266 | (3) |
|
12 Are We Living In A Computer Simulation? |
|
|
269 | (14) |
|
Project #16 Life, the Universe, and Yertle's Pond |
|
|
270 | (9) |
|
|
270 | (3) |
|
Implications of the Pond Simulation |
|
|
273 | (2) |
|
Measuring the Cost of Crossing the Lattice |
|
|
275 | (2) |
|
|
277 | (1) |
|
|
278 | (1) |
|
|
279 | (1) |
|
|
279 | (1) |
|
|
279 | (1) |
|
Challenge Project: Finding a Safe Space |
|
|
279 | (1) |
|
Challenge Project: Here Comes the Sun |
|
|
280 | (1) |
|
Challenge Project: Seeing Through a Dog's Eyes |
|
|
281 | (1) |
|
Challenge Project: Customized Word Search |
|
|
281 | (1) |
|
Challenge Project: Simplifying a Celebration Slideshow |
|
|
281 | (1) |
|
Challenge Project: What a Tangled Web We Weave |
|
|
281 | (1) |
|
Challenge Project: Go Tell It on the Mountain |
|
|
281 | (2) |
|
Appendix: Practice Project Solutions |
|
|
283 | (32) |
|
Chapter 2 Attributing Authorship with Stylometry |
|
|
283 | (2) |
|
Hunting the Hound with Dispersion |
|
|
283 | (1) |
|
|
284 | (1) |
|
Chapter 4 Sending Super-Secret Messages with a Book Cipher |
|
|
285 | (4) |
|
|
285 | (1) |
|
Sending Secrets the WWII Way |
|
|
286 | (3) |
|
|
289 | (3) |
|
Plotting the Orbital Path |
|
|
289 | (1) |
|
|
290 | (2) |
|
Chapter 6 Winning the Moon Race with Apollo 8 |
|
|
292 | (6) |
|
Simulating a Search Pattern |
|
|
292 | (1) |
|
|
293 | (3) |
|
|
296 | (2) |
|
Chapter 7 Selecting Martian Landing Sites |
|
|
298 | (6) |
|
Confirming That Drawings Become Part of an Image |
|
|
298 | (1) |
|
Extracting an Elevation Profile |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
300 | (4) |
|
Chapter 8 Detecting Distant Exoplanets |
|
|
304 | (8) |
|
Detecting Alien Megastructures |
|
|
304 | (1) |
|
Detecting Asteroid Transits |
|
|
305 | (1) |
|
Incorporating Limb Darkening |
|
|
306 | (1) |
|
Detecting an Alien Armada |
|
|
307 | (2) |
|
Detecting a Planet with a Moon |
|
|
309 | (2) |
|
Measuring the Length of an Exoplanet's Day |
|
|
311 | (1) |
|
Chapter 9 Identifying Friend or Foe |
|
|
312 | (1) |
|
|
312 | (1) |
|
Chapter 10 Restricting Access with Face Recognition |
|
|
312 | (3) |
|
Challenge Project: Adding a Password and Video Capture |
|
|
312 | (3) |
Index |
|
315 | |