I managed to solve this exercise but dont understand why we are using m = X.shape[1] as the number of elements to be divided instead of X.size or Y.size?

I suppose you could, but the common strategy in this course is to use the object’s shape.

Thanks TMosh - then shouldnt we use X.shape?

If you’re using numpy, then the shape method seems to be preferred.

Thank You