Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy scale array

a = np.array([]) # Your values
np.interp(a, (a.min(), a.max()), (-1, +1))
Comment

scale in numpy

abs_max = np.amax(np.abs(unnormalized_array))
normalized_array = unnormalized_array * (4.0 / abs_max)
Comment

PREVIOUS NEXT
Code Example
Python :: bar plot 
Python :: raw input example py 
Python :: python returned non-zero exit status 1. 
Python :: smallest number of 3 python 
Python :: python make 1d array from n-d array 
Python :: python 2.7 venv 
Python :: str to datetime time 
Python :: get method in python dictionary 
Python :: how to make tkinter look better 
Python :: format date string python 
Python :: pack tkinter 
Python :: python code to demonstrate inheritance 
Python :: iterate through list python with index 
Python :: extract outliers from boxplot 
Python :: os.startfile() python 
Python :: appending to a list python 
Python :: how to remove element from nested list in python 
Python :: Python Tkinter PanedWindow Widget 
Python :: exponent in python 
Python :: type python 
Python :: change password serializer 
Python :: Character limit python system 
Python :: Check and Install appropriate ChromeDriver Version for Selenium Using Python 
Python :: python access modifiers 
Python :: python module location 
Python :: beautifulsoup 
Python :: Create an array of 10 zeros 
Python :: program to add first and last digit of a number in python 
Python :: __lt__ 
Python :: multiprocessing in jupyter notebook 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =