9951 explained code solutions for 126 technologies


python-pandasHow to calculate 10th percentile 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.1)ctrl + c
import pandas as pd

load Pandas module

data

will contain loaded DataFrame

.quantile(

calculates specified quantile (percentile)

'Phone Price'

column to calculate quantile (percentile) for

0.1

will calculate 10% percentile