python-pandasHow to get 0.9 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.9)ctrl + c| import pandas as pdload Pandas module | datawill contain loaded DataFrame | 
| .quantile(calculates specified quantile | 'Phone Price'column to calculate quantile for | 
| 0.9will calculate 0.9 quantile | |
Usage 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.9)
print(q)output
404.6
Related
More of Python Pandas
- What is opposite of melt() in Pandas
- How to install openpyxl module
- How to convert column values to Int
- How to find dataframe max
- How to convert yyyymmdd string to datetime
- How to select not null values from dataframe
- How to convert datetime to year
- How to calculate 25th percentile for dataframe
- How to join dataframes on multiple columns
- How to read dataframe from XML
See more codes...