Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 797 Bytes

how-to-get-099-quantile-for-dataframe.md

File metadata and controls

40 lines (29 loc) · 797 Bytes

How to get 0.99 quantile for dataframe

import pandas as pd

data = pd.DataFrame({
  'Phone': ['ip5', 'ip6', 'ip8', 'sms', 'xi'],
  'Phone Price': [204, 304, 404, 405, 305]
})

q = data['Phone Price'].quantile(0.99)
  • import pandas as pd - load lib:Pandas module
  • data - will contain loaded DataFrame
  • .quantile( - calculates specified quantile
  • 'Phone Price' - column to calculate quantile for
  • 0.99 - will calculate 0.99 quantile

group: quantile

Example:

import pandas as pd

phoneDataSet = {
  'Phone': ['ip5', 'ip6', 'ip8', 'sms', 'xi'],
  'Phone Price': [204, 304, 404, 405, 305]
}

data = pd.DataFrame(phoneDataSet)
q = data['Phone Price'].quantile(0.99)

print(q)
404.96