How do I fix mis-rendered matplotlib?
Try using numpy's log or log1p. The math module also offers logarithmic functionality.

You can use sklearn to transform your variables - see MinMaxScaler, StandardScaler, etc.

Other transformations like Box-Cox can be found in scipy.stats