W3 assignment examples do not use np.dot?

After learning about vectorization and NumPy dot operators and the many benefits they confer, I’m curious as to why the examples and hints in the graded assignment fallback to the iterative, non-parallel approach for calculating z for logistic regression.

That is, instead of using np.dot to compute x dot w, the examples suggest looping through all the rows in the matrix and manually summing w[j] * X[i][j] (I don’t think we can post solutions here so I’ve omitted the exact example).

Is it done this way to drive a certain point home? Are there times when this more verbose approach is more appropriate than np.dot?

Andrew feels that using for-loops may be more intuitive for students who don’t have a background in linear algebra.

You may use whichever method you prefer. The grader only checks your function’s return values - it doesn’t inspect your code.

Generally, you would never use for-loops instead of numpy functions.

Thank you for your insight! That helps to clear the ambiguity around intent