Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Range all columns of df such that the minimum value in each column is 0 and max is 1. in pandas

import pandas as pd 

df = pd.DataFrame(np.random.randint(1,100, 80).reshape(8, -1))

out = df.apply(lambda x:((x.max()-x)/(x.max()-x.min())).round(2))
Comment

PREVIOUS NEXT
Code Example
Python :: twitter scraping python 
Python :: python combinations function 
Python :: lru cache 
Python :: software developer tools list 
Python :: pandas unstring list 
Python :: convert iso 8601 to milliseconds python 
Python :: selenium session id python 
Python :: python derivative of mean squared error 
Python :: class variable in python 
Python :: insert value in string python 
Python :: python += dictionary 
Python :: get output of a function in a variable python 
Python :: del df.loc 
Python :: turtle screen 
Python :: from sklearn.metrics import confusion_matrix pred = model.predict(X_test) pred = np.argmax(pred,axis = 1) y_true = np.argmax(y_test,axis = 1) 
Python :: pass query params django template 
Python :: python split string on char 
Python :: string in netcdf file python 
Python :: python last non-zero value in a list 
Python :: using python for rest api 
Python :: convert float with missing values to integer 
Python :: how to inheritance in python 
Python :: installing intel-numpy 
Python :: python set terminal size 
Python :: python combine nested for loops 
Python :: mountain array leetcode 
Python :: python cheat 
Python :: numpy shape 
Python :: return variable python 
Python :: concatenate strings of numpy array python 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =