I'm trying to normalize the variable by using normalized = 30 * (x-min(x))/(max(x)-min(x))
to 0-30 scale.
In python it would be:
new_escore = esg_funds['Portfolio Environmental Score'].apply(lambda x: 30*(x-esg_funds['Portfolio Environmental Score'].min())/(esg_funds['Portfolio Environmental Score'].max()-esg_funds['Portfolio Environmental Score'].min()))
esg_funds
is my data, and 'Portfolio Environmental Score'
is the variable.
How do I use apply()
function here?