Skip to content

Commit a1256c1

Browse files
authored
Merge pull request #970 from ndporter/patch-1
Base "middle" on 0-index consistently
2 parents 0d555f2 + 2b22761 commit a1256c1

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
@@ -203,16 +203,16 @@ first value in data: 0.0
203203
{: .output}
204204
205205
~~~
206-
print('middle value in data:', data[30, 20])
206+
print('middle value in data:', data[29, 19])
207207
~~~
208208
{: .language-python}
209209
210210
~~~
211-
middle value in data: 13.0
211+
middle value in data: 16.0
212212
~~~
213213
{: .output}
214214
215-
The expression `data[30, 20]` accesses the element at row 30, column 20. While this expression may
215+
The expression `data[29, 19]` accesses the element at row 30, column 20. While this expression may
216216
not surprise you,
217217
`data[0, 0]` might.
218218
Programming languages like Fortran, MATLAB and R start counting at 1

0 commit comments

Comments
 (0)