Hello everyone,
I'm trying to use lambdify on some matrix expression, but my problem is
that the shape of the matrix expr is not preserved. this is an example of
my problem:
'''
from sympy import Symbol, Matrix
from sympy.utilities.lambdify import lambdify
xi = Symbol("xi")
eta = Symbol("eta")
phi = Symbol("phi")
mat22 = Matrix([[xi+1,eta],[phi+2,eta]])
mat11 = Matrix([[xi+1]])
mat00 = Matrix([[]])
print("shape of the expression")
print(mat22.shape)
print(mat11.shape)
print(mat00.shape)
symbols = [xi,eta,phi]
args = [0,1,2]
print("shape of the lambdify expression")
print(lambdify(symbols,mat22)(*args).shape)
print(lambdify(symbols,mat11)(*args).shape)
print(lambdify(symbols,mat00)(*args).shape)
''
output:
shape of the expretion
(2, 2)
(1, 1)
(0, 0)
shape of the lambdify expretion
(2, 2)
(1, 1)
(0,) <----- i will like to have (0,0)
Any idea on how to solve this issue
using :
Python 3.6.10 |Anaconda, Inc.| (default, May 8 2020, 02:54:21)
[GCC 7.3.0] on linux
>>> sympy.__version__
'1.5.1'
Felipe
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/80b8258a-a76e-4c6c-a0c0-30911d481b13n%40googlegroups.com.