from IPython.display import display, Math
def print_matrix(array):
data = ''
for line in array:
if len(line) == 1:
data += ' %.3f &'%line + r' \\\n'
continue
for element in line:
data += ' %.3f &'%element
data += r' \\' + '\n'
display(Math('\\begin{bmatrix} \n%s\end{bmatrix}'%data))
© 版权声明
THE END
暂无评论内容