Skip to content

CountDistinct() Source

Bases: Statistic

Number of distinct values that are not missing.

[1, 1, 2] gives 2.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Paris"])
cities.compute(ndp.CountDistinct()).to_value()
# 2