I have [6, -1, -3, -5]. I want to make the negative values positive, e.g. [6, 1, 3, 5]. Is there an easy way to do this?
Thank you so much, in advance!
>Solution :
Simply use the builtin abs function:
>>> a = np.array( [6, -1, -3, -5])
>>> a
array([ 6, -1, -3, -5])
>>> abs(a)
array([6, 1, 3, 5])