Comment #4 on issue 671 by [email protected]: implement Matrix.apply_map like
in Sage
http://code.google.com/p/sympy/issues/detail?id=671
I don't understand, what is wrong with this issue.
In interactive mode (isympy) I get this results:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = map(Function, 'fgh')
>>> m = Matrix([[1, x, 0], [0, 1, x], [0, 0, 1]])
>>> m
[1, x, 0]
[0, 1, x]
[0, 0, 1]
>>> m.applyfunc(lambda e: sin(e))
[sin(1), sin(x), 0]
[ 0, sin(1), sin(x)]
[ 0, 0, sin(1)]
even
>>> m.applyfunc(sin)
[sin(1), sin(x), 0]
[ 0, sin(1), sin(x)]
[ 0, 0, sin(1)]
>>> m.applyfunc(f)
[f(1), f(x), f(0)]
[f(0), f(1), f(x)]
[f(0), f(0), f(1)]
>>> m.applyfunc(lambda e: e*e)
[1, x**2, 0]
[0, 1, x**2]
[0, 0, 1]
>>> m.applyfunc(lambda e: sin(e).series(x, n=3))
[sin(1), x + O(x**3), 0]
[ 0, sin(1), x + O(x**3)]
[ 0, 0, sin(1)]
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.