def to_latex(a,label='A \\oplus B'): | |
sys.stdout.write('\[ ' | |
+ label | |
+ ' = \\left| \\begin{array}{' | |
+ ('c'*a.shape[1]) | |
+ '}\n' ) | |
for r in a: | |
sys.stdout.write(str(r[0])) | |
for c in r[1:]: | |
sys.stdout.write(' & '+str(c)) | |
sys.stdout.write('\\\\\n') | |
sys.stdout.write('\\end{array} \\right| \]\n') |
This comment has been minimized.
This comment has been minimized.
def to_matrix(a,frmt = '{:1.2f}', arraytype = 'bmatrix'):
to_matrix(Krm, frmt = '{:1.2f}', arraytype = 'array') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
An alternative (which I haven't yet posted).