SymPy - substitute sybolic entries in a matrix

后端 未结 3 1255
暗喜
暗喜 2021-01-24 00:54

I have a python function which generates a sympy.Matrix with symbolic entries. It works effectively like:

import sympy as sp
M = sp.Matrix([[1,0,2],[0,1,2],[1,2,         


        
3条回答
  •  爱一瞬间的悲伤
    2021-01-24 01:52

    Symbols are defined by their name. Two symbols with the same name will considered to be the same thing by Sympy. So if you know the name of the symbols you want, just create them again using symbols.

    You may also find good use of the zip function of Python.

提交回复
热议问题