Prose error describing numpy rows and columns relative to axis number...#321

Open
opened this issue Oct 7, 2016 · 2 comments
Open

Prose error describing numpy rows and columns relative to axis number... #321

opened this issue Oct 7, 2016 · 2 comments
Labels
good first issue Good issue for first-time contributors help wanted Looking for Contributors
Milestone

KjellSwedin commented Oct 7, 2016

 The following line shows rows with axis 0: "If we ask for the average across axis 0 (rows in our 2D example), we get:" and here columns are show with axis 1: "If we average across axis 1 (columns in our 2D example), we get:" The diagram above correctly shows axis 0 as columns and axis 1 as rows. The text was updated successfully, but these errors were encountered:

djinnome commented Jan 9, 2017 • edited

 Perhaps this episode has been updated since October 7, but the prose looks correct to me and consistent with the diagram, although it could be clearer. The current text is a bit glib about the semantics of `axis`, which could lead to confusion. `numpy.mean(data, axis=0) ` means "Take the average across all rows (axis=0) for each column. The diagram shows the result, which is a vector of columns". Likewise, `numpy.mean(data, axis=1)` means "Take the average across all columns (axis=1) for each row. The diagram shows the result, which is a vector of rows". The main inconsistency that I would like to report is that the diagram uses object notation to take the mean: `data.mean(axis=1)` whereas the code cell uses functional notation: `print(numpy.mean(data, axis=1))` While both notations are correct, this discrepancy adds more cognitive burden to the learner. Secondly, in the diagram, the `axis=1` example is shown first, followed by the `axis=0` example, whereas in the code cells, the `axis=0` example is shown first, followed by the `axis=1` example. Again, while both the code and the diagram are correct, it adds more cognitive burden to the learner than if the examples were consistent in their ordering. Finally, in the diagram, the `axis=1` example applies the `max` operator, and the `axis=0` example applies the `mean` operator, but in the code cells directly following the diagram, both examples apply the `mean` operator. If there were more parallelism between the diagram and the code, then the episode would be easier to learn.

pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this issue May 6, 2017
``` Merge pull request swcarpentry#321 from swcarpentry/lex-video-length-1 ```
``` ce488b4 ```
`Add max length of first video`

valentina-s commented Oct 23, 2017

 Yes, it will be great if those clarifications are added and the inconsistencies are eliminated. PR's welcome!

mentioned this issue Dec 20, 2017
added help wanted Looking for Contributors good first issue Good issue for first-time contributors and removed help-wanted labels Jun 8, 2018
added this to the June 2019 Release milestone May 14, 2019