vDataFrame.quantile¶
In [ ]:
vDataFrame.quantile(q: list,
columns: list = [],
approx: bool = True,
**agg_kwds)
Aggregates the vDataFrame using a list of 'quantiles'.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
q | list | ❌ | List of the different quantiles. They must be numbers between 0 and 1. For example [0.25, 0.75] will return Q1 and Q3. |
columns | list | ✓ | List of the vcolumns names. If empty, all the vcolumns will be used. |
approx | bool | ✓ | If set to True, the approximate quantile is returned. By setting this parameter to False, the function's performance can drastically decrease. |
**agg_kwds | any | ✓ | Any optional parameter to pass to the Aggregate function. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [4]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic)
In [2]:
# Approximate quantiles
titanic.quantile(q = [0.1, 0.22, 0.5, 0.9],
columns = ["age", "fare"],
approx = True)
Out[2]:
In [5]:
# Exact quantiles
titanic.quantile(q = [0.1, 0.22, 0.5, 0.9],
columns = ["age", "fare"],
approx = False)
Out[5]:
See Also¶
vDataFrame.aggregate | Computes the vDataFrame input aggregations. |