Matrix Problem In Python Mean