How can I convert a negative number to positive in Python? (And keep a positive one.)
How can I convert a negative number to positive in Python? (And keep a positive one.)
If you are working with numpy you can use
import numpy as np
np.abs(-1.23)
>> 1.23
It will provide absolute values.