Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scale values in 0 100 python

import numpy as np

def NormalizeData(data):
    return (data - np.min(data)) / (np.max(data) - np.min(data))

X = np.array([
    [ 0,  1],
    [ 2,  3],
    [ 4,  5],
    [ 6,  7],
    [ 8,  9],
    [10, 11],
    [12, 13],
    [14, 15]
])

scaled_x = NormalizeData(X)

print(scaled_x)
Comment

scale values in 0 100 python

import numpy as np

def NormalizeData(data):
    return (data - np.min(data)) / (np.max(data) - np.min(data)) *100

X = np.array([
    [ 0,  1],
    [ 2,  3],
    [ 4,  5],
    [ 6,  7],
    [ 8,  9],
    [10, 11],
    [12, 13],
    [14, 15]
])

scaled_x = NormalizeData(X)

print(scaled_x)
Comment

PREVIOUS NEXT
Code Example
Python :: python django adding category 
Python :: Exiting from python Command Line 
Python :: convert string ranges list python 
Python :: save standard output in variable python 
Python :: make django admin page text box smaller 
Python :: python bot ban script 
Python :: dates and times in python 
Python :: python string not contains 
Python :: tensorflow use growing memory 
Python :: horizontal barplot 
Python :: pass query params django template 
Python :: python filter list 
Python :: how to comment python 
Python :: split string with first numerical value in python 
Python :: Write a simple python program that adds 2 numbers togethe 
Python :: how to combine number of excel files into a single file using python or pandas 
Python :: print index in for loop python 
Python :: python open file check error 
Python :: panda loc conditional 
Python :: us staes python 
Python :: print value of array python 
Python :: get second min no from array in python 
Python :: how to check python version in script 
Python :: reshape (-1,1) 
Python :: xlrd python read excel 
Python :: Example pandas.read_hfd5() 
Python :: decorators in python 
Python :: how to pre populate field flask wtforms 
Python :: tuple push 
Python :: seaborn factorplot python 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =