Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas add quantile columns

df['quantile'] = pd.qcut(df['b'], 2, labels=False)

   a    b  quantile
0  1    1         0
1  2   10         0
2  3  100         1
3  4  100         1
Comment

PREVIOUS NEXT
Code Example
Python :: how to take input for list in python 
Python :: colorbar font size python 
Python :: save list to dataframe pandas 
Python :: pandas length of dataframe 
Python :: how to find if the numpy array contains negative values 
Python :: copy list python 
Python :: python find object with attribute in list 
Python :: python all lowercase letters 
Python :: Adding function to a varieble in python 
Python :: random picker python 
Python :: size of the query process in python BigQuery 
Python :: OneHotEncoder() 
Python :: python set day of date to 1 
Python :: python multiaxis slicing 
Python :: numpy array input 
Python :: box plot seaborn python 
Python :: back button django template 
Python :: python call function from string 
Python :: replace nan numpy array 
Python :: python json normalize 
Python :: python if in range 
Python :: last index in python 
Python :: pygame size of image 
Python :: lambda python 
Python :: How to construct a prefix sum array in python? 
Python :: python argparse file argument 
Python :: clean column names pandas 
Python :: python get function name 
Python :: python get subset of dictionary 
Python :: push element to list python 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =