Feedback about an error

There is an error in a week 2 programming assignment documentation.
There should be axis=0 for row and axis=1 for column.

Please find attachment.

1 Like

Hey @nomi , which course is this ?

@Mubsi, it is course 1(neural networks and deep learning) of deep learning specialization.

Thanks, @nomi. To have your queries answered, and promptly, kindly try and put them in the right category. For now, I have replaced it. In the future, please be mindful of where you post so that we can help better.

Hey @kenb , @petrifast, can you please take a look at this ? Thanks.

1 Like

@Mubsi Sorry for that, next time I will. Actually I was unaware of how this category thing works.

1 Like

Hey @nomi we have made a Guide to Discourse for precisely this reason. Give it a read sometime: Discourse guide for learners - Google Docs

1 Like

Thanks @Mubsi , actually while learning all that stuff, it fascinates me so much that I didn’t bother myself to read that discourse guideline but I will read these guideline now.

1 Like

HI @nomi. This appears to be mostly semantic confusion. I have a hard time keeping it straight myself. The axis=0 option means that one aggregates (sums, means, etc) “down” the rows of a matrix; axis=1 means that one sums “across” the columns of the matrix. Apparently, “row-wise” means that you are aggregating the elements of the individuals rows.


Hi @kenb and @nomi,

Indeed, the axis value is not intuitive and the language in the problem set, while correct, is a bit nuanced.

When in doubt, I usually create an empty cell and try out the operation on an example numpy matrix. After applying the aggregate across an axis I check the shape of the result to see if the aggregation took place over the direction I want.


My 2 cents, when I think about axis = 1, I see the 1 as something “vertical” which helps me remind that value is for columns :slight_smile:


Hi @nomi,
@kenb has already given you a good answer.
If you still have doubts, take a look at the “Broadcasting in Python” video of week 2, from minute 4:04 you will find the explanation. :wink:

1 Like

Thanks @kenb, this explanation is satisfying. Actually in order to keep reminding myself I have built the connection between dimension of matrix and axis. Like, in dimension of a matrix (3,2) the the zero element represents rows and element one represents columns of matrix and due to this connection and after reading documentation of axis in python, I thought it might be an error which I mentioned but I didn’t think in other way around. But, your this explanation is very helpful.

1 Like

Hi @petrifast, Lol I also do the same thing in lot of scenario, it help me to think in clear way.

1 Like