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