Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

group by quintiles pandas

df = pd.DataFrame(np.arange(10), columns=['value'])
df['quintile'] = pd.qcut(df['value'], 5, labels=False)
df

  value quintile
1   1   0
2   2   1
3   3   1
4   4   2
5   5   2
6   6   3
7   7   3
8   8   4
9   9   4
10  10   5
Comment

PREVIOUS NEXT
Code Example
Python :: Run flask on docker with postgres and guinicorn 
Python :: python program to convert csv file into pdf 
Python :: python 3 download 
Python :: python concat list multiple times 
Python :: uri beecrowd problem 1047 Game Time with Minutes 
Python :: # find the n smallest and greatest numbers in list 
Python :: how to solve differential equations in python 
Python :: KeyError: 0 
Python :: django qurry 
Python :: load shapefile fiona multiline intersection 
Python :: axis legend get labels and handles 
Python :: restrict memory use python code 
Python :: print numbers 1 to 10 using recursion in python 
Python :: BIDS extract JSON data 
Python :: Simple Python Permutation Passing argument as the second parameter 
Python :: python finding mead 
Python :: unique character 03 set and length comparison 
Python :: unique lits on python 
Python :: strain rate 
Python :: get complete path from reletive path python 
Python :: Find element with class name in requests-html python 
Python :: Python NumPy moveaxis function Example 
Python :: python request port 
Python :: Python NumPy require Function Example with requirements attribute 
Python :: TemplateDoesNotExist at / 
Python :: python __div__ 
Python :: hide ticks without hiding grid 
Python :: NumPy right_shift Code When inputs and bit shift are an arrays 
Python :: after logout using back button is letting it use the flask application 
Python :: how to avoind DeprecationWarning in python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =