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
Try a list comprehension:
x2 = [abs(k) for k in x]