My question is very simple, suppose that I have an array like
array = np.array([1, 2, 3, 4])
and I\'d like to get an array like
<
Other possible ways to get the reciprocal of each element of an array of integers:
Using numpy's reciprocal:
inv = np.reciprocal(array.astype(np.float32))
Cast:
inv = 1/(array.astype(np.float32))