The standard numpy methods for calculation mean squared error (variance) and its square root (standard deviation) are numpy.var()
and numpy.std()
, see here and here. They apply to matrices and have the same syntax as numpy.mean()
.
I suppose that the question and the preceding answers might have been posted before these functions became available.