calculate percentile pandas dataframe

import pandas as pd
import random

A = [ random.randint(0,100) for i in range(10) ]
B = [ random.randint(0,100) for i in range(10) ]

df = pd.DataFrame({ 'field_A': A, 'field_B': B })
df
#    field_A  field_B
# 0       90       72
# 1       63       84
# 2       11       74
# 3       61       66
# 4       78       80
# 5       67       75
# 6       89       47
# 7       12       22
# 8       43        5
# 9       30       64

df.field_A.mean()   # Same as df['field_A'].mean()
# 54.399999999999999

df.field_A.median() 
# 62.0

# You can call `quantile(i)` to get the i'th quantile,
# where `i` should be a fractional number.

df.field_A.quantile(0.1) # 10th percentile
# 11.9

df.field_A.quantile(0.5) # same as median
# 62.0

df.field_A.quantile(0.9) # 90th percentile
# 89.10000000000001

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
dataframe percentage describe pandas percentiles python dataframe percentage get percentiles pandas pandas percent value dataframe percentiles data frame percentiles pandas display percent python pandas dataframe get percentage percent in pandas percentile pandas column get percentile values python dataframe percentile of data using df get percentile dataframe 78th percentile pandas dataframe pandas column with percentile denote percentage in calculations pandas describe percentiles pandas pandas percentile of column pandas rolling percentile Calculating percentile python on dataset taking percentile of a dataframe percentage pandas dataframe percentile calculation in pandas pandas get percentiles of column pandas find percentile of a column create percentile column pandas calculate percentage in dataframe python get percentiles and mena in pandas get percentile of column pandas how to get the 80 percentile in pandas pandas describe percentiles meaning calculate percentage in pandas how to calculate percentage in python pandas pandas describe percentiles how to calculate percentage of values in pandas get percentile pandas series percentage in pandas dataframe return percentiles describe pandas how to calculte percentile on dataframe see percentiles pandas pandas percent return pandas percentage check percentile pandas how to get percentile values in python pandas pandas value to percentile python pandas percentile calculate percentile in pandas how to calculate percentile in python without panda calculating percentiles formula pandas calculate the percentile of a value pandas how to calculate percentile in dataframe python percentage in pandas how to calculate percentage in python dataframe size percentile pandas dataframe percent pandas dataframe find percent of column total find out percentile in pandas percent cange in pandas pandas what is percentile find percentile in dataFrame percentile pandas python pandas percentile of a column pandas percentiles pandas percentiles get percentile of a column pandas pandas describe with percentiles calculate percentiles pandas percentile from dataframe python calculate percentile in python dataframe calculating percentile in python daatframe percentile python pandas how to use percentiles in pandas describe percentile pandas percentiles pandas pandas calculate percentage calculate percent for column in pandas 75th percentile in dataframe python percentile in pandas.describe pandas percent pandas series get percentile get 70 th percentile python pandas get percentile pandas how to find quantile in pandas python df quartile quartiles pandas .percentile() pandas quantile datafreame approx_percentile i pandas calculate percent total pandas pandas quantile function pandas 95 percentile get quantiles from df dataframe percentile dataframe quantile python percentile function pandas padnas column percentile percentile pandas percentile explanation how to find the 75th percentile in pandas percentile 90 python pandas how to get percentile in pandas quartile in pandas pandas dataframe calculate percentage df.list quantile percentile pandas dataframe pd.quantiles df col quantile display percentile in pandas get percentile value pandas pandas get JUST quartiles pandas quantiles of a list df.quantile(0.25) python return quartile of each row dataframe column quantile plot dataframe column quantile percentile with pandas choosse percentil values columns pandas pandas series 90th percentile df percentile calulate percent total dataframe percentile python get column names drop columns with more quantiles pandas quantile python calculate quartiles in pandas dataset percentile in pandas quantiles pandas df quatile plot Q Q column python pandas 90th percentile quantile python pandas calculate percentile in pandas' percentile of pandas pandas select percentile get first quartile of all numeric column a dataframe python python quartile pandas pandas get quantile python get quantile of column pandas calculate percentile quantile in python pandas how to calculate percentile in pandas in python how to calculate quantile in pandas in python quintile pandas how to calculate percentile columns wise in pandas how to percentile from pandas how to get percentiles in pandas Q1=df.quantile(0.25) pandas interquartile range find the quantile of all data in a dataframe python find the quantile of all data in a dataframe df.quantile find 99% of data in a dataframe how to get particular percentile in pandas Find 25%,50% & 75% quartile value of\ a column in pandas how to find 70th percentile in pandas pandas get 25 to 75 percentile pandas get quantile given value in a column pandas get quantile of column pandas histogram quantile get terciles pandas dataframe how to calculate 75% in dataframe column select percentile of rows pandas quartiles of series pandas quartiles pandas python pd.quantile find the 99th percentile from a dataframe column pandas set quantiles pandas quantile different than mean pandas 95th percentile pandas comparing percentiles Use describe and quantile to calculate the Interquartile spread in pandas df quantile get percentile of pandas column percentile of a column pandas select quantil from discribe get quartiles of a column pandas select stcks quantile return panda divide a dataframe in quantile find 50 percentile in dataframe how to find 40th percentile of colmn in pandas pandas quantile vs prcentile quantile function panas get the qurtiles of a dataframe pandas first quantile get 75 percentile value pandas finding quartile pandas pandas get percentile Determine the 90th percentile for all the columns. in python pandas get quartiles find 99 percentile value in dataset python\ percentiles in pandas meaning of pandas 75% meaning of pandas 75th pandas quantiles pandas quartiles higher quantile means pandas dataframe quantile dataframe quartile percentile cont similar function in pandas find dataframe quantile print 75th-100th quantile of a column print 75th quantile of a column print top 25th percentile of a columkn find first quantile of dataframe col how to make dataframe percentile by index value percentile pandas how to calculate percentile of a column in python pandas percintil calculate quantiles pandas pandas percentile quartile pandas what number of shares fall at the 78th percentile python .quantile pandas pandas compute q1 quantile pandas rename quantile column pandas create dataframe of percentile pandas calculate percentile for multiple columns pandas and reset index calculate percentile for multiple columns pandas percentile 0 to 100 in pandas percentile in pandas quantile in pandas pandas percentil get 90% quantile pandas quantile statistics of columns in pandas pd df percentaial pandas quantile pandas get quartils calculate percentile pandas dataframe
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source