Skip to content

Latest commit

 

History

History
executable file
·
41 lines (30 loc) · 594 Bytes

sympy.jupyter.md

File metadata and controls

executable file
·
41 lines (30 loc) · 594 Bytes

sympy

import numpy as np
from  IPython.display import display, Math, Latex
import sympy as sp
raw_latex = "\\text{%s} \quad W*X^T" % ("e.g.")

raw_latex
display(Math(raw_latex))
display(Latex("$"+raw_latex+"$"))
a1 = np.eye(2, 2, dtype=np.int)

a1

显示np.array

raw_latex1 = "\\text{e.g.} \quad %s" % (sp.sympify(a1))
raw_latex2 = "\\text{e.g.} \quad %s" % (sp.latex(sp.sympify(a1)))

raw_latex1, raw_latex2
display(Math(sp.latex(raw_latex1)))
display(Math(sp.latex(raw_latex2)))