New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index error in 'Analyzing Patient Data' - #362

ozej8y opened this Issue Mar 21, 2017 · 2 comments


None yet
2 participants

ozej8y commented Mar 21, 2017

In the lesson 'Analyzing Patient Data' there is an index error.

After the heading 'Mystery Functions in IPython', is the line:

print('maximum inflammation for patient 2:', numpy.max(data[2, :]))

Since indexation in python starts at 0, Patient 2 should be numpy.max(data[1, :])


This comment has been minimized.

GregoryRHart commented Mar 22, 2017

If you look at the example above that you will see that the patients are also being zero indexed:

patient_0 = data[0, :] # 0 on the first axis, everything on the second
print('maximum inflammation for patient 0:', patient_0.max())

So patient 2 is the 3rd patient in the list and thus in index 2.

However, this was quite confusing for those in the workshop I attended. It might be helpful to add a call out box indicating that we are shifting our language to match the array indexing. i.e. The array starts with the zeroth patient, then the first patient, etc.


This comment has been minimized.

ozej8y commented Mar 22, 2017

Hi Greg,

You are correct, a call out box would help to clarify the issue.


rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this issue May 6, 2017

Merge pull request swcarpentry#362 from maxim-belkin/fix2
expiry.txt: more consistent wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment