n_distinct
In [1]:
Copied!
# https://dplyr.tidyverse.org/reference/n_distinct.html
%run nb_helpers.py
from datar.all import sample, n_distinct
nb_header(sample, n_distinct, book='n_distinct')
# https://dplyr.tidyverse.org/reference/n_distinct.html
%run nb_helpers.py
from datar.all import sample, n_distinct
nb_header(sample, n_distinct, book='n_distinct')
In [2]:
Copied!
x = sample(range(10), 1e5, replace=True)
len(x)
x = sample(range(10), 1e5, replace=True)
len(x)
Out[2]:
100000
In [3]:
Copied!
n_distinct(x)
n_distinct(x)
Out[3]:
10