Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

logartim normalization python pandas

# To transform to logarithms, you need positive values,
# so translate your range of values (-1,1] to normalized (0,1] as follows

import numpy as np
import pandas as pd

df = pd.DataFrame(np.random.uniform(-1,1,(10,1)))
df['norm'] = (1+df[0])/2 # (-1,1] -> (0,1]
df['lognorm'] = np.log(df['norm'])
 
PREVIOUS NEXT
Tagged: #logartim #normalization #python #pandas
ADD COMMENT
Topic
Name
7+6 =