October 2019
Beginner to intermediate
674 pages
16h 43m
English
The quantile() function returns the value for every column for the specified quantiles. It accepts a single quantile value or an array of quantile values:
sales_df.quantile(q = [0.1, 0.9])
The following is the output:

Quantiles can also be computed for timestamps. We can achieve this by setting the numeric_only parameter to False:
time_col = pd.DataFrame({"time": pd.date_range("2017-01-01", "2017-12-31")})time_col.quantile(q = [0.1, 0.5], numeric_only = False)
The following is the output:
Read now
Unlock full access