vDataFrame.nunique¶
In [ ]:
vDataFrame.nunique(columns: list = [],
approx: bool = True,
**agg_kwds,)
Aggregates the vDataFrame by cardinality.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
columns | list | ✓ | List of vColumns to use in the aggregation. If empty, all vColumns are used. |
approx | bool | ✓ | If set to True, the approximate cardinality is returned. Setting this parameter to false will give exact results, but decrease performance. |
**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 [15]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic)
In [14]:
# approx cardinality
titanic.nunique(columns = ["pclass", "embarked", "survived", "cabin"],
approx = True)
Out[14]:
In [16]:
# exact cardinality
titanic.nunique(columns = ["pclass", "embarked", "survived", "cabin"],
approx = False)
Out[16]:
See Also¶
vDataFrame.aggregate | Computes the vDataFrame input aggregations. |