Created
February 28, 2021 18:39
-
-
Save konverner/b63802b9a51076f03a7b8f1d02632261 to your computer and use it in GitHub Desktop.
pretty matrix print in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_matrix(M,precision=3): | |
M_copy = M.copy() | |
M_copy = np.round(M_copy,precision) | |
for row in M_copy: | |
print(str("{:>10} "*len(M)).format(*row)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment