1 | initial version |
You should first define a callable symbolic expression containing 2*h0
:
f(r) = 2*h0
and then call
A.apply_map(lambda x: x.substitute_function(function('h'), f))
Then A[:]
yields
[2*h0(r) 0]
[ 0 0]