Question: CodeGeneration[Python] returning round brackets for matrix, [Maple18]

CodeGeneration returns round brackets when converting a matrix to numpy. According to Python syntax it should return square brackets. I am using Maple 18, so maybe this issue has been solved in more recent releases.


local Q:
Q:= Matrix(2,2):
Q(1,1) := 1E5:
Q(2,2) := 1E4:
Q(1,2) := 1E3:
Q(2,1) := 1E3:
return Q:
end proc:


import numpy

def QLoc ():
    Q = numpy.mat([[0,0],[0,0]])
    Q(1, 1) = 0.1e6
    Q(2, 2) = 0.1e5
    Q(1, 2) = 0.1e4
    Q(2, 1) = 0.1e4


Please Wait...