Skip to content

Commit 48925df

Browse files
JostMigendaRobadob
andcommitted
Apply suggestions from code review
Co-authored-by: Robert Chisholm <[email protected]>
1 parent e1fa64d commit 48925df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

episodes/optimisation-numpy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Using Scientific Python Libraries (NumPy, Pandas and more)"
2+
title: "Using Scientific Python Packages (NumPy, Pandas and more)"
33
teaching: 30
44
exercises: 0
55
---
@@ -193,7 +193,7 @@ Most modern processors are able to apply one instruction across multiple variabl
193193
If we were to use a regular `for` loop, the time to perform this operation would increase with the length of the array.
194194
However, using NumPy broadcasting we can apply the addition to 1, 10 or 100 elements, all in the same amount of time!
195195

196-
Earlier in this episode it was demonstrated that using core Python methods over a list will outperform a loop, performing the same calculation faster. The below example takes this a step further by demonstrating the calculation of a dot product.
196+
Earlier it was demonstrated that using core Python methods over a list will outperform a loop, performing the same calculation faster. The below example takes this a step further by demonstrating the calculation of a dot product.
197197

198198
<!-- Inspired by High Performance Python Chapter 6 example
199199
Added Python sum array, skipped a couple of others-->
@@ -268,7 +268,7 @@ These libraries could be specific to your area of research; but they could also
268268
:::::::::::::::::::::::::::::::::::::::::::::::
269269

270270

271-
Which libraries you may use will depend on your research domain; here, we'll show two examples from our own experience.
271+
Which libraries you may use will depend on your research domain; here, we'll show an example from bioinformatics.
272272

273273
### Example: Image Analysis with Shapely
274274

@@ -304,7 +304,7 @@ points_per_polygon = {}
304304
for polygon_idx in range(n_polygons):
305305
current_polygon = polygons.iloc[polygon_idx,:]["geometry"]
306306

307-
# vectorised: apply `contains` to an array of points at once
307+
# vectorised: apply `contains` to an array of points, rather than an individual point
308308
points_in_polygon_idx = current_polygon.contains(points_array)
309309
points_in_polygon = point_names_array[points_in_polygon_idx]
310310

0 commit comments

Comments
 (0)