This comment has been minimized.

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.

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