Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #add #quantile #columns
ADD COMMENT
Topic
Name
6+4 =