diff --git a/episodes/03-matplotlib.md b/episodes/03-matplotlib.md index baccbdb7f..af0e5faa0 100644 --- a/episodes/03-matplotlib.md +++ b/episodes/03-matplotlib.md @@ -48,7 +48,7 @@ image = matplotlib.pyplot.imshow(data) matplotlib.pyplot.show() ``` -![](fig/inflammation-01-imshow.svg){alt='Heat map representing the data variable. Each cell is colored by value along a color gradientfrom blue to yellow.'} +![](fig/inflammation-01-imshow.svg){alt='Heat map representing the data variable. Each cell is colored by value along a color gradient from blue to yellow.'} Each row in the heat map corresponds to a patient in the clinical trial dataset, and each column corresponds to a day in the dataset. Blue pixels in this heat map represent low values, while @@ -242,7 +242,7 @@ axes3.set_ylim(numpy.amin(min_data), numpy.amax(min_data) * 1.1) ## Drawing Straight Lines In the center and right subplots above, we expect all lines to look like step functions because -non-integer value are not realistic for the minimum and maximum values. However, you can see +non-integer values are not realistic for the minimum and maximum values. However, you can see that the lines are not always vertical or horizontal, and in particular the step function in the subplot on the right looks slanted. Why is this? diff --git a/episodes/04-lists.md b/episodes/04-lists.md index b356b7471..a2afa3b66 100644 --- a/episodes/04-lists.md +++ b/episodes/04-lists.md @@ -169,7 +169,7 @@ Since a list can contain any Python variables, it can even contain other lists. For example, you could represent the products on the shelves of a small grocery shop as a nested list called `veg`: -![](fig/04_groceries_veg.png){alt='veg is represented as a shelf full of produce. There are three rows of vegetableson the shelf, and each row contains three baskets of vegetables. We can labeleach basket according to the type of vegetable it contains, so the top rowcontains (from left to right) lettuce, lettuce, and peppers.'} +![](fig/04_groceries_veg.png){alt='veg is represented as a shelf full of produce. There are three rows of vegetables on the shelf, and each row contains three baskets of vegetables. We can label each basket according to the type of vegetable it contains, so the top row contains (from left to right) lettuce, lettuce, and peppers.'} To store the contents of the shelf in a nested list, you write it this way: @@ -183,7 +183,7 @@ Here are some visual examples of how indexing a list of lists `veg` works. First you can reference each row on the shelf as a separate list. For example, `veg[2]` represents the bottom row, which is a list of the baskets in that row. -![](fig/04_groceries_veg0.png){alt='veg is now shown as a list of three rows, with veg\[0\] representing the top row ofthree baskets, veg\[1\] representing the second row, and veg\[2\] representing the bottom row.'} +![](fig/04_groceries_veg0.png){alt='veg is now shown as a list of three rows, with veg\[0\] representing the top row of three baskets, veg\[1\] representing the second row, and veg\[2\] representing the bottom row.'} Index operations using the image would work like this: @@ -206,7 +206,7 @@ print(veg[0]) To reference a specific basket on a specific shelf, you use two indexes. The first index represents the row (from top to bottom) and the second index represents the specific basket (from left to right). -![](fig/04_groceries_veg00.png){alt='veg is now shown as a two-dimensional grid, with each basket labeled according toits index in the nested list. The first index is the row number and the secondindex is the basket number, so veg\[1\]\[3\] represents the basket on the far rightside of the second row (basket 4 on row 2): zucchini'} +![](fig/04_groceries_veg00.png){alt='veg is now shown as a two-dimensional grid, with each basket labeled according to its index in the nested list. The first index is the row number and the second index is the basket number, so veg\[1\]\[3\] represents the basket on the far right side of the second row (basket 4 on row 2): zucchini'} ```python print(veg[0][0]) diff --git a/episodes/05-loop.md b/episodes/05-loop.md index aa79cce6d..06e1cb64d 100644 --- a/episodes/05-loop.md +++ b/episodes/05-loop.md @@ -23,7 +23,7 @@ In the episode about visualizing data, we wrote Python code that plots values of interest from our first inflammation dataset (`inflammation-01.csv`), which revealed some suspicious features in it. -![](fig/03-loop_2_0.png){alt="Line graphs showing average, maximum and minimum inflammation across all patients over a 40-dayperiod."} +![](fig/03-loop_2_0.png){alt="Line graphs showing average, maximum and minimum inflammation across all patients over a 40-day period."} We have a dozen data sets right now and potentially more on the way if Dr. Maverick can keep up their surprisingly fast clinical trial rate. We want to create plots for all of @@ -142,7 +142,7 @@ for variable in collection: Using the odds example above, the loop might look like this: -![](fig/05-loops_image_num.png){alt="Loop variable 'num' being assigned the value of each element in the list odds in turn andthen being printed"} +![](fig/05-loops_image_num.png){alt="Loop variable 'num' being assigned the value of each element in the list odds in turn and then being printed"} where each number (`num`) in the variable `odds` is looped through and printed one number after another. The other numbers in the diagram denote which loop cycle the number was printed in (1 diff --git a/episodes/06-files.md b/episodes/06-files.md index 4d8b3af83..e3330943f 100644 --- a/episodes/06-files.md +++ b/episodes/06-files.md @@ -93,13 +93,13 @@ inflammation-01.csv inflammation-02.csv ``` -![](fig/03-loop_49_3.png){alt='Output from the second iteration of the for loop. Three line graphs showing the daily average, maximum and minimum inflammation over a 40-day period for all patients in the seconddataset.'} +![](fig/03-loop_49_3.png){alt='Output from the second iteration of the for loop. Three line graphs showing the daily average, maximum and minimum inflammation over a 40-day period for all patients in the second dataset.'} ```output inflammation-03.csv ``` -![](fig/03-loop_49_5.png){alt='Output from the third iteration of the for loop. Three line graphs showing the daily average, maximum and minimum inflammation over a 40-day period for all patients in the thirddataset.'} +![](fig/03-loop_49_5.png){alt='Output from the third iteration of the for loop. Three line graphs showing the daily average, maximum and minimum inflammation over a 40-day period for all patients in the third dataset.'} The plots generated for the second clinical trial file look very similar to the plots for the first file: their average plots show similar "noisy" rises and falls; their maxima plots @@ -111,7 +111,7 @@ the first two datasets, however the minima plot shows that the third dataset min consistently zero across every day of the trial. If we produce a heat map for the third data file we see the following: -![](fig/inflammation-03-imshow.svg){alt='Heat map of the third inflammation dataset. Note that there are sporadic zero values throughoutthe entire dataset, and the last patient only has zero values over the 40 day study.'} +![](fig/inflammation-03-imshow.svg){alt='Heat map of the third inflammation dataset. Note that there are sporadic zero values throughout the entire dataset, and the last patient only has zero values over the 40 day study.'} We can see that there are zero values sporadically distributed across all patients and days of the clinical trial, suggesting that there were potential issues with data collection throughout the diff --git a/episodes/08-func.md b/episodes/08-func.md index 88557a7f3..cbbd4353d 100644 --- a/episodes/08-func.md +++ b/episodes/08-func.md @@ -909,7 +909,7 @@ def numbers(one, two=2, three, four=4): print(numbers(1, three=3)) ``` -what do you expect will be printed? What is actually printed? +What do you expect will be printed? What is actually printed? What rule do you think Python is following? 1. `1234`