Jul-04-2019, 01:14 AM
Given below is source code for Pandas dataframe :
What will be the mathematical formula/calculation for quantile ? How this output comes i don't know so please expalin with simple math calculation here ..
import pandas as pd diSales= { 2016:{'qtr1':34500,'qtr2':56000,'qtr3':47000,'qtr4':49000}, 2017:{'qtr1':44900,'qtr2':46100,'qtr3':57000,'qtr4':59000}, 2018:{'qtr1':54500,'qtr2':51000,'qtr3':57000,'qtr4':58500}, 2019:{'qtr1':61000} } ks = pd.DataFrame(diSales) ptr = ks.quantile([0.25,0.5,0.75,1.0]) print(ptr)Output:
Output: 2016 2017 2018 2019
0.25 43875.0 45800.0 53625.0 61000.0
0.50 48000.0 51550.0 55750.0 61000.0
0.75 50750.0 57500.0 57375.0 61000.0
1.00 56000.0 59000.0 58500.0 61000.0
What will be the mathematical formula/calculation for quantile ? How this output comes i don't know so please expalin with simple math calculation here ..