Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

normalise list python

>>> a = [2,4,10,6,8,4]
>>> amin, amax = min(a), max(a)
>>> for i, val in enumerate(a):
...     a[i] = (val-amin) / (amax-amin)
...
>>> a
[0.0, 0.25, 1.0, 0.5, 0.75, 0.25]
Comment

PREVIOUS NEXT
Code Example
Python :: python datetime minus days 
Python :: age calculator in python 
Python :: how to get the user ip in djagno 
Python :: virtualenv -p python3 
Python :: qpushbutton text alignment 
Python :: get desktop location python 
Python :: create random dataframe pandas 
Python :: print terminal url 
Python :: matplotlib plot data 
Python :: print(np.round(df.isnull().sum() / len(df), 2)) 
Python :: python plot_confusion_matrix 
Python :: flatten a list of list python 
Python :: pyplot set x range 
Python :: python push into array if not exists 
Python :: pad zeros to a string python 
Python :: how to make a alert box in python 
Python :: python zip listas diferente tamaño 
Python :: no module named base45 windows 
Python :: DateTime object representing DateTime in Python 
Python :: python trim string to length 
Python :: python scatter plot 
Python :: program to segregate positive and negative numbers in same list 
Python :: you are trying to access thru https but only allows http django 
Python :: Filler values must be provided when X has more than 2 training features 
Python :: how to get words from a string in python 
Python :: python selenium wait for page to load 
Python :: pandas dataframe creation column names 
Python :: qlineedit autocomplete python 
Python :: list python shuffling 
Python :: .annotate unique distinct 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =