1
$\begingroup$

I want to normalize the data between 0 and 95 instead of 0 and 100. I am using this formula to normalize between 0 and 100, please let me know how to edit it.

def normalization(data):
    return(data - np.min(data)) / (np.max(data) - np.min(data))
$\endgroup$

1 Answer 1

1
$\begingroup$

Just multiply every value by $0.95$. Your original $0$ will stay at $0$; your original $100$ will be reduced to $95$; and the original values in between will be reduced a bit, too.

$\endgroup$
3
  • $\begingroup$ you mean (data - np.min(data)) / (np.max(data) - np.min(data))* 0. 95? $\endgroup$ Jun 20, 2021 at 23:30
  • $\begingroup$ That’s the code, yes (though I didn’t look at your function to make sure it gives values between $0$ and $100$). $\endgroup$
    – Dave
    Jun 20, 2021 at 23:31
  • $\begingroup$ it does and the above solution worked, thank you! $\endgroup$ Jun 20, 2021 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.