First time here? Check out the FAQ!
answered 2021-12-18 22:32:41 +0100
You can use the apply_map method :
apply_map
sage: v.apply_map(sign) (1, 0, -1) sage: m.apply_map(lambda x : x^2) [ 1 4] [ 9 16]