I am trying to convert a list that contains negative values, to a list of non-negative values; inverting the negative ones. I have tried abs but it didn\'t work
abs
The simple pythonic way is the list comprehension above but if you're using Numpy for anything else you could do:
x2 = numpy.abs(x)
with no need to convert or do any looping.