I have the following numpy array:
sample_size = 100000
z = np.random.randn(sample_size)
What would be an elegant way to say:
if z >= 0: f = 1 + z
if z < 0: f = 1 / (2 - z)
I have the following numpy array:
sample_size = 100000
z = np.random.randn(sample_size)
What would be an elegant way to say:
if z >= 0: f = 1 + z
if z < 0: f = 1 / (2 - z)