Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Alternative : the apply_map method :

sage: M=matrix([u/13 for u in range(9)], ncols=3) ; M
[   0 1/13 2/13]
[3/13 4/13 5/13]
[6/13 7/13 8/13]
sage: M.apply_map(lambda u:round(u,2))
[ 0.0 0.08 0.15]
[0.23 0.31 0.38]
[0.46 0.54 0.62]

HTH,