Skip to content

Commit 2b22761

Browse files
authored
Base "middle" on 0-index consistently
This section of the lesson is inconsistent. It uses data[30,20] as a midpoint but states that this is the 30th row and 20th column. Either the indices should be changed (per PR) and the text updated a little or the text should be changed to reflect that this is the 31st row and 21st column (not 30th and 20th).
1 parent 06bb720 commit 2b22761

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_episodes/02-numpy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,16 @@ first value in data: 0.0
205205
{: .output}
206206
207207
~~~
208-
print('middle value in data:', data[30, 20])
208+
print('middle value in data:', data[29, 19])
209209
~~~
210210
{: .language-python}
211211
212212
~~~
213-
middle value in data: 13.0
213+
middle value in data: 16.0
214214
~~~
215215
{: .output}
216216
217-
The expression `data[30, 20]` accesses the element at row 30, column 20. While this expression may
217+
The expression `data[29, 19]` accesses the element at row 30, column 20. While this expression may
218218
not surprise you,
219219
`data[0, 0]` might.
220220
Programming languages like Fortran, MATLAB and R start counting at 1

0 commit comments

Comments
 (0)