Matrix Problem In Python Example