Why isn't mean() working as shown in Jeremy's ML Lecture?

Continuing the discussion from The use of mean() in rmse(x,y) lecture 1,2: